September 2017
Beginner to intermediate
360 pages
8h 13m
English
Grouping operation is an built-in operation of Storm Trident. It is performed by the groupBy function. It repartitions tuples using partitionBy and then within the partition it groups all the tuples that have the same group fields. Code example:
topology.newStream("spout", spout).each(new Fields("sentence"), new Split(), new Fields("word")) .groupBy(new Fields("word")).persistentAggregate(stateFactory, new Count(), new Fields("count"));
As per Storm Trident documentation, the group by function is explained using the following diagram:

Read now
Unlock full access