SessionWindowedKStream
is the contract of KStreams that allows Kafka Streams developers for aggregate, count and reduce aggregations over a session-windowed record stream.
SessionWindowedKStream
is created using KGroupedStream.windowedBy method.
package org.apache.kafka.streams.kstream;
interface SessionWindowedKStream<K, V> {
<VR> KTable<Windowed<K>, VR> aggregate(
final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator,
final Merger<? super K, VR> sessionMerger);
<VR> KTable<Windowed<K>, VR> aggregate(
final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator,
final Merger<? super K, VR> sessionMerger,
final Materialized<K, VR, SessionStore<Bytes, byte[]>> materialized);
KTable<Windowed<K>, Long> count();
KTable<Windowed<K>, Long> count(
final Materialized<K, Long, SessionStore<Bytes, byte[]>> materialized);
KTable<Windowed<K>, V> reduce(final Reducer<V> reducer);
KTable<Windowed<K>, V> reduce(
final Reducer<V> reducer,
final Materialized<K, V, SessionStore<Bytes, byte[]>> materializedAs);
}
Method | Description |
---|---|
|
|
|
|
|
Note
|
SessionWindowedKStreamImpl is the one and only known implementation of SessionWindowedKStream Contract in Kafka Streams {{ book.kafka_version }}. |