Dear all,
One simple question about parallelism of storm and shared variables.
If I set parallelism count to 4 for example, and there are some member
variables in that bolt.
Is it shared across 4 bolts or not?
Seems like each is seperate object and they don't share nothing, which is the
opposite way from what I expected.
For example, if I run this bolt in local mode, 4 counters is being incremented
seperately,
public class PercolatorBolt extends BaseBasicBolt {
private int i = 0;
@Override
public void prepare(Map stormConf, TopologyContext context) {
}
public void execute(Tuple tuple, BasicOutputCollector collector) {
synchronized(this){
System.out.println(i++);
}
}
}
I want to here from you about this topic, thanks.
Sincerely,