Interface Reducer<V>

Type Parameters:
V - value type

public interface Reducer<V>
The Reducer interface for combining two values of the same type into a new value. In contrast to Aggregator the result type must be the same as the input type.

The provided values can be either original values from input KeyValue pair records or be a previously computed result from apply(Object, Object).

Reducer can be used to implement aggregation functions like sum, min, or max.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(V value1, V value2)
    Aggregate the two given values into a single one.
  • Method Details

    • apply

      V apply(V value1, V value2)
      Aggregate the two given values into a single one.
      Parameters:
      value1 - the first value for the aggregation
      value2 - the second value for the aggregation
      Returns:
      the aggregated value