Introducing Trident aggregators – Combiners and Reducers
Akin to functions, aggregators
allow topologies to combine tuples. Unlike functions, they replace tuple fields and values. There are three different types of aggregators: CombinerAggregator
, ReducerAggregator
, and Aggregator
.
CombinerAggregator
A CombinerAggregator
is used to combine a set of tuples into a single field. It has the following signature:
public interface CombinerAggregator { T init (TridentTuple tuple); T combine(T val1, T val2); T zero(); }
Storm calls the init()
method with each tuple, and then repeatedly calls the combine()
method until the partition is processed. The values passed into the combine()
method are partial aggregations, the result of combining the values returned ...
Get Storm Blueprints: Patterns for Distributed Real-time Computation now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.