- Type Parameters:
K- key type
V- input value type
VA- aggregate value type
public interface Aggregator<K,
Aggregatorinterface for aggregating values of the given key. This is a generalization of
Reducerand allows to have different types for input value and aggregation result.
Aggregatoris used in combination with
Initializerthat provides an initial aggregation value.
Aggregator can be used to implement aggregation functions like count.
- See Also:
KGroupedStream.aggregate(Initializer, Aggregator, Materialized)
TimeWindowedKStream.aggregate(Initializer, Aggregator, Materialized)
SessionWindowedKStream.aggregate(Initializer, Aggregator, Merger)
SessionWindowedKStream.aggregate(Initializer, Aggregator, Merger, Materialized)
applyCompute a new aggregate from the key and value of a record and the current aggregate of the same key.
key- the key of the record
value- the value of the record
aggregate- the current aggregate value
- the new aggregate value