K
- Type of primary keysV
- Type of value changes@InterfaceStability.Unstable
public interface KGroupedTable<K,V>
KGroupedTable
is an abstraction of a grouped changelog stream from a primary-keyed table,
usually on a different grouping key than the original primary key.
It is an intermediate representation after a re-grouping of a KTable
before an aggregation is applied
to the new partitions resulting in a new KTable
.
Modifier and Type | Method and Description |
---|---|
<T> KTable<K,T> |
aggregate(Initializer<T> initializer,
Aggregator<K,V,T> adder,
Aggregator<K,V,T> substractor,
Serde<T> aggValueSerde,
String name)
Aggregate updating values of this stream by the selected key into a new instance of
KTable . |
<T> KTable<K,T> |
aggregate(Initializer<T> initializer,
Aggregator<K,V,T> adder,
Aggregator<K,V,T> substractor,
String name)
Aggregate updating values of this stream by the selected key into a new instance of
KTable
using default serializers and deserializers. |
KTable<K,Long> |
count(String name)
Count number of records of this stream by the selected key into a new instance of
KTable . |
KTable<K,V> |
reduce(Reducer<V> adder,
Reducer<V> subtractor,
String name)
Combine updating values of this stream by the selected key into a new instance of
KTable . |
KTable<K,V> reduce(Reducer<V> adder, Reducer<V> subtractor, String name)
KTable
.adder
- the instance of Reducer
for additionsubtractor
- the instance of Reducer
for subtractionname
- the name of the resulted KTable
KTable
with the same key and value types as this KGroupedTable
,
containing aggregated values for each key<T> KTable<K,T> aggregate(Initializer<T> initializer, Aggregator<K,V,T> adder, Aggregator<K,V,T> substractor, Serde<T> aggValueSerde, String name)
KTable
.T
- the value type of the aggregated KTable
initializer
- the instance of Initializer
adder
- the instance of Aggregator
for additionsubstractor
- the instance of Aggregator
for subtractionaggValueSerde
- value serdes for materializing the aggregated table,
if not specified the default serdes defined in the configs will be usedname
- the name of the resulted tableKTable
with same key and aggregated value type T
,
containing aggregated values for each key<T> KTable<K,T> aggregate(Initializer<T> initializer, Aggregator<K,V,T> adder, Aggregator<K,V,T> substractor, String name)
KTable
using default serializers and deserializers.T
- the value type of the aggregated KTable
initializer
- the instance of Initializer
adder
- the instance of Aggregator
for additionsubstractor
- the instance of Aggregator
for subtractionname
- the name of the resulted KTable
KTable
with same key and aggregated value type T
,
containing aggregated values for each key