Interface ParallelAggregator<I,E,O,ACC extends Accumulator<I,E,O>>

All Superinterfaces:
Aggregator<I,E,O>
All Known Implementing Classes:
AggCounting, AggErrorHandler, AggFromCollector, AggInputBroadcast, AggInputBroadcastMap, AggInputFilter, AggInputFlatMap, AggInputSplit, AggInputTransform, AggLcaMap, AggNatural, AggOutputTransform, AggReduce

public interface ParallelAggregator<I,E,O,ACC extends Accumulator<I,E,O>> extends Aggregator<I,E,O>
Aggregator suitable for parallel processing. Extends Aggregator with a method to combine accumulators.
Author:
raven
  • Method Details

    • createAccumulator

      ACC createAccumulator()
      Specified by:
      createAccumulator in interface Aggregator<I,E,O>
    • combine

      ACC combine(ACC a, ACC b)
      Combine accumulators. This method is allowed to mutate any of if its arguments, hence accumulators should be considered exhausted after combination.
      Parameters:
      a - First participant of combination
      b - Second participant of combination
      Returns:
      Combined accumulator
    • combineRaw

      default ACC combineRaw(Object x, Object y)
      Combine method that works on Objects. Exact type signatures are typically too unwieldy to be carried around in user code. Delegates to combine(Accumulator, Accumulator) thus its notes apply.
      Parameters:
      x - First participant of combination
      y - Second participant of combination
      Returns:
      Combined accumulator
    • asCollector

      default Collector<I,?,O> asCollector()
    • asCollector

      default Collector<I,?,O> asCollector(E env)
      Wrap this aggregator as a Java8 collector.
      Returns:
      The collector view of this aggregator