KGroupedStream
is the abstraction of a grouped record stream that allows Kafka Streams developers for aggregate, count, reduce and windowedBy stream aggregations.
KGroupedStream
is the result of the following aggregate stream operators:
Tip
|
Use Scala API for Kafka Streams to make your Kafka Streams development more pleasant if Scala is your programming language. |
import org.apache.kafka.streams.scala.StreamsBuilder
import org.apache.kafka.streams.scala._
import ImplicitConversions._
import Serdes._
val builder = new StreamsBuilder
val groupedKStream = builder
.stream[String, String]("events")
.groupByKey
scala> :type groupedKStream
org.apache.kafka.streams.scala.kstream.KGroupedStream[String,String]
Method | Description |
---|---|
|
KTable<K, VR> aggregate(
final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator)
KTable<K, VR> aggregate(
final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator,
final Materialized<K, VR, KeyValueStore<Bytes, byte[]>> materialized) Creates a KTable with a given |
|
KTable<K, Long> count()
KTable<K, Long> count(
final Materialized<K, Long, KeyValueStore<Bytes, byte[]>> materialized) Creates a KTable with a given Materialized (view of a KeyValueStore) |
|
KTable<K, V> reduce(final Reducer<V> reducer)
KTable<K, V> reduce(
final Reducer<V> reducer,
final Materialized<K, V, KeyValueStore<Bytes, byte[]>> materialized) Creates a KTable with a given |
|
SessionWindowedKStream<K, V> windowedBy(final SessionWindows windows) Creates a SessionWindowedKStream with a given |
|
<W extends Window> TimeWindowedKStream<K, V> windowedBy(final Windows<W> windows) Creates a TimeWindowedKStream with a given Windows window specification |
Note
|
KGroupedStreamImpl is the one and only known implementation of the KGroupedStream Contract in Kafka Streams {{ book.kafka_version }}. |