Package org.apache.kafka.streams.kstream
Interface Aggregator<K,V,VA>
-
- Type Parameters:
K- key typeV- input value typeVA- aggregate value type
public interface Aggregator<K,V,VA>TheAggregatorinterface for aggregating values of the given key. This is a generalization ofReducerand allows to have different types for input value and aggregation result.Aggregatoris used in combination withInitializerthat provides an initial aggregation value.Aggregatorcan be used to implement aggregation functions like count.- See Also:
Initializer,KGroupedStream.aggregate(Initializer, Aggregator),KGroupedStream.aggregate(Initializer, Aggregator, Materialized),TimeWindowedKStream.aggregate(Initializer, Aggregator),TimeWindowedKStream.aggregate(Initializer, Aggregator, Materialized),SessionWindowedKStream.aggregate(Initializer, Aggregator, Merger),SessionWindowedKStream.aggregate(Initializer, Aggregator, Merger, Materialized),Reducer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VAapply(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.
-