Please read this page http://storm.apache.org/documentation/Concepts.html
firstly.Let me explain several conception:In storm, one worker means one
process, one executor means one thread, one task means one bolt or spout
instance.In jstorm, worker means process, task also means one thread and one
bolt or spout instance. there is no executor.builder.setBolt("xxx", new
XXXBolt(), 10);In storm, this will create 10 executor, due to not set task
parallel, the default ratio of executor and task is 1, there are 10 tasks, .
Every task will occupy one executor (thread).In jstorm, this will create 10
tasks. Every task occupy one threadbuilder.setBolt("xxx", new XXXBolt(),
10).setNumTasks(20);In storm, this will create 10 executor, 20 tasks, Every
two tasks will occupy one executor (thread).In jstorm, this will create 10
tasks. Every task will occupy one thread.There is a little confusion between
Storm and JStorm, but later in Storm 2.0, we will unify
them.regardsLongda------------------------------------------------------------------From:Dollyn
<[email protected]>Send Time:2015年11月26日(星期四) 17:54To:user
<[email protected]>Subject:Will Storm/JStorm new a separate bolt instance
for every task/thread?For example:builder.setBolt("xxx", new XXXBolt(),
10)Assume that there is only one worker, how many XXXBolt's java object
instance will be there? 1 or 10?In fact, I did some test by add the following
code in the execute method:LOGGER.debug("BoltID: {}, ThreadID: {} - {}",
System.identityHashCode(this), Thread.currentThread().getName(),
Thread.currentThread().getId());The result is:BoltID: 558207946, ThreadID:
analyze_bolt:4-BoltExecutors - 107BoltID: 1052936813, ThreadID:
analyze_bolt:5-BoltExecutors - 103Seems that there is instance for every
thread, but can't be sure that will or not bolt instance will be reused among
tasks/threads, and the document does not make this clear either.-- Dollyn