For a simple word count program in the storm-starter, the logic is fairly straight-forward:
1) split sentence into words
2) emit each word
3) aggregate the count (store the count in a map)
However, there are two problems here:
1) the program uses 12 individual threads to execute the aggregation part, which means the count is not GLOBAL, we have to add one more layer to get the global count?
2) in the bolt, maps are used to store the count, which means it has state, what if the current worker fails, all counts stored in the bolt are gone? since storm is stateless
3) should we use Trident to achieve this instead?