You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by 唐思成 <ja...@qq.com> on 2014/08/01 04:34:35 UTC
回复: The Parallelism of a bolt
basically, it is like this:
public void execute(Tuple tuple) { List.add(tuple); if (List.size() >= 1000 ) { collect.emit(List); } }
and I write a simple demo, the result confirms your reply, thx.
------------------ 原始邮件 ------------------
发件人: "Nathan Leung";<nc...@gmail.com>;
发送时间: 2014年7月31日(星期四) 晚上7:48
收件人: "user"<us...@storm.incubator.apache.org>;
主题: Re: The Parallelism of a bolt
Are you emitting in a separate thread? If so, yes. If not, no.
On Jul 31, 2014 7:45 AM, "唐思成" <ja...@qq.com> wrote:
Recently, I came across a question. Suppose I have a bolt withing a ArrayList as its private field, every time this bolt receives a tuple, it store the incoming tuple into this list, And when the list's size reach a certain value, the bolth emit the a the whole list.
The question is should I implement this List as thread safe or not ?
2014-07-31
唐思成