Interface Aggregator<K,V,VA>

Type Parameters:
K - key type
V - input value type
VA - aggregate value type

public interface Aggregator<K,V,VA>
The Aggregator interface for aggregating values of the given key. This is a generalization of Reducer and allows to have different types for input value and aggregation result. Aggregator is used in combination with Initializer that provides an initial aggregation value.

Aggregator can be used to implement aggregation functions like count.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(K key, V value, VA aggregate)
    Compute a new aggregate from the key and value of a record and the current aggregate of the same key.
  • Method Details

    • apply

      VA apply(K key, V value, VA aggregate)
      Compute a new aggregate from the key and value of a record and the current aggregate of the same key.
      Parameters:
      key - the key of the record
      value - the value of the record
      aggregate - the current aggregate value
      Returns:
      the new aggregate value