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";<ncle...@gmail.com>;
????????: 2014??7??31??(??????) ????7:48
??????: "user"<user@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, "??????" <jadetan...@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  
 
 ??????

Reply via email to