O'Reilly logo

Storm Blueprints: Patterns for Distributed Real-time Computation by Brian O'Neill, P. Taylor Goetz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required