August 2017
Beginner to intermediate
284 pages
6h 51m
English
The ReducerAggregator first runs the global repartitioning operation on the input stream to combine all the partitions of the same batch into a single partition, and then runs the aggregation function on each batch. The ReducerAggregator<T> interface contains the following methods:
This example shows how we can implement Sum using the ReducerAggregator:
public static class Sum implements ReducerAggregator<Long> { private static final long serialVersionUID = 1L; /** return the initial value zero */ public Long init() { return 0L; } /** Iterates on the input ...Read now
Unlock full access