Interface Aggregator<B,E,T>

Type Parameters:
B - The type of bindings being accumulated by the accumulator.
E - The environment/context to be passed to accumulator.
T - The result object of the accumulation.
All Known Subinterfaces:
ParallelAggregator<I,E,O,ACC>
All Known Implementing Classes:
AggCounting, AggErrorHandler, AggFinish, AggFromCollector, AggInputBroadcast, AggInputBroadcastMap, AggInputFilter, AggInputFlatMap, AggInputSplit, AggInputTransform, AggLcaMap, AggNatural, AggOutputTransform, AggReduce
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Aggregator<B,E,T>
Interface for agregators.
  • Method Details

    • createAccumulator

      Accumulator<B,E,T> createAccumulator()
    • finish

      default <U> Aggregator<B,E,U> finish(SerializableFunction<T,U> transform)
      Transform the final value of an aggregation
    • accumulateAll

      default Optional<T> accumulateAll(Stream<? extends B> stream, E env)
      Convenience function to sequentially accumulate a given stream. Closes the stream when done. For ParallelAggregator use stream.collect(parallelAggregator.asCollector());
    • accumulateAll

      default Optional<T> accumulateAll(Iterable<? extends B> iterable, E env)
      Convenience function to sequentially accumulate a given iterable
    • accumulateAll

      default Optional<T> accumulateAll(Iterator<? extends B> it, E env)
      Convenience function to sequentially accumulate a given iterator