Hi all,
I am new to Storm/Trident and would like to implement something like this:
TridentState *wordCount* =
topology.newStream("spout1", spout)
.each(new Fields("sentence"), new Split(), new Fields("word"))
.partitionAggregate(new Fields("word"), new Count(), new
Fields("newCount"))
.stateQuery(*wordCount*, new Fields("word"), new MapGet(), new
Fields("currentWeightedCount"))
.each(new Fields("currentWeightedCount","newCount"), new
WeightedCountCalculator(), new Fields("newWeightedCount"))
.partitionPersist(new WordCountFactory(), new Fields("word",
"newWeightedCount"), new WordCountUpdater())
This code is not executable because wordCount refers to itself. Are there
any workarounds?
Thanks,
Chia-Chun