Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1.78 KB

kafka-streams-SessionWindowedKStream.adoc

File metadata and controls

49 lines (40 loc) · 1.78 KB

SessionWindowedKStream — Session-Windowed Stream Aggregations

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);
}
Table 1. SessionWindowedKStream Contract
Method Description

aggregate

count

reduce

Note
SessionWindowedKStreamImpl is the one and only known implementation of SessionWindowedKStream Contract in Kafka Streams {{ book.kafka_version }}.