As far as I know, setting parallelism for a spout/bolt doesn't increase the
number of threads in which it is executed. If you need to increase the
number of threads, you need to set the num_workers to be the number you
need.

On Thu, Jan 29, 2015 at 4:17 PM, 余昊 <[email protected]> wrote:

> Hi,
>
> I set the parallelism of a bolt to 3 with the java code:
>     *builder.setBolt("myBolt", myBolt, 3);*
>
> I think, 3 myBolt instances would be created in 3 tasks each of which
> would run in a different thread (i.e. executor) in parallel. To prove
> that,  I printed out the bolt instance name in the prepare() method of
> MyBolt class, expecting 3 different instance names in the worker log files.
>
> However, things did not always go like that. I tested twice, the second
> topology worked as I expected. But in the first topology, 6701,6702,6703
> ports were assigned to "myBolt", and I found the exactly same bolt instance
> name in worker-6701.log and worker-6702.log files, which were different
> from  worker-6703.log file.
>
> So how to explain this?
>
> ------------------------------
> Hao Yu
>



-- 
Regards,
Pandian

Reply via email to