K
- key typeV
- input value typeVA
- aggregate value typepublic interface Aggregator<K,V,VA>
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.
Initializer
,
KGroupedStream.aggregate(Initializer, Aggregator, org.apache.kafka.common.serialization.Serde, String)
,
KGroupedStream.aggregate(Initializer, Aggregator, org.apache.kafka.streams.processor.StateStoreSupplier)
,
KGroupedStream.aggregate(Initializer, Aggregator, Windows, org.apache.kafka.common.serialization.Serde, String)
,
KGroupedStream.aggregate(Initializer, Aggregator, Windows, org.apache.kafka.streams.processor.StateStoreSupplier)
,
KGroupedStream.aggregate(Initializer, Aggregator, Merger, SessionWindows, org.apache.kafka.common.serialization.Serde, String)
,
KGroupedStream.aggregate(Initializer, Aggregator, Merger, SessionWindows, org.apache.kafka.common.serialization.Serde, org.apache.kafka.streams.processor.StateStoreSupplier)
,
Reducer
Modifier and Type | Method and Description |
---|---|
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.
|