KTable
is the abstraction of a changelog stream from a primary-keyed table. Each record in the changelog stream is an update on the primary-keyed table with the record key as the primary key.
KTable
assumes that records from the source topic that have null
keys are simply dropped.
KTable
can be created directly from a Kafka topic (using StreamsBuilder.table operator), as a result of transformations on an existing KTable
, or aggregations (aggregate
, count
, and reduce
) of the following abstractions:
-
KGroupedStream (KStream.groupBy and KStream.groupByKey aggregate stream operators)
-
SessionWindowedKStream (KGroupedStream.windowedBy stream operator)
-
TimeWindowedKStream (KGroupedStream.windowedBy stream operator with a TimeWindows window specification)
Tip
|
Use Scala API for Kafka Streams to make your Kafka Streams development more pleasant if Scala is your programming language. |
Operator | Description |
---|---|
|
KTable<K, V> filter(
Predicate<? super K, ? super V> predicate)
KTable<K, V> filter(
Predicate<? super K, ? super V> predicate,
Materialized<K, V, KeyValueStore<Bytes, byte[]>> materialized) |
|
KTable<K, V> filterNot(
Predicate<? super K, ? super V> predicate)
KTable<K, V> filterNot(
Predicate<? super K, ? super V> predicate,
Materialized<K, V, KeyValueStore<Bytes, byte[]>> materialized) |
|
KGroupedTable<KR, VR> groupBy(
KeyValueMapper<? super K, ? super V, KeyValue<KR, VR>> selector)
KGroupedTable<KR, VR> groupBy(
KeyValueMapper<? super K, ? super V, KeyValue<KR, VR>> selector,
Grouped<KR, VR> grouped) |
|
KTable<K, VR> join(
KTable<K, VO> other,
ValueJoiner<? super V, ? super VO, ? extends VR> joiner)
KTable<K, VR> join(
KTable<K, VO> other,
ValueJoiner<? super V, ? super VO, ? extends VR> joiner,
Materialized<K, VR, KeyValueStore<Bytes, byte[]>> materialized) |
|
KTable<K, VR> leftJoin(
KTable<K, VO> other,
ValueJoiner<? super V, ? super VO, ? extends VR> joiner)
KTable<K, VR> leftJoin(
KTable<K, VO> other,
ValueJoiner<? super V, ? super VO, ? extends VR> joiner,
Materialized<K, VR, KeyValueStore<Bytes, byte[]>> materialized) |
|
KTable<K, VR> mapValues(
ValueMapper<? super V, ? extends VR> mapper)
KTable<K, VR> mapValues(
ValueMapper<? super V, ? extends VR> mapper,
Materialized<K, VR, KeyValueStore<Bytes, byte[]>> materialized)
KTable<K, VR> mapValues(
ValueMapperWithKey<? super K, ? super V, ? extends VR> mapper)
KTable<K, VR> mapValues(
ValueMapperWithKey<? super K, ? super V, ? extends VR> mapper,
Materialized<K, VR, KeyValueStore<Bytes, byte[]>> materialized) |
|
KTable<K, VR> outerJoin(
KTable<K, VO> other,
ValueJoiner<? super V, ? super VO, ? extends VR> joiner)
KTable<K, VR> outerJoin(
KTable<K, VO> other,
ValueJoiner<? super V, ? super VO, ? extends VR> joiner,
Materialized<K, VR, KeyValueStore<Bytes, byte[]>> materialized) |
|
String queryableStoreName() |
|
KTable<K, V> suppress(
Suppressed<? super K> suppressed) |
|
KStream<K, V> toStream()
KStream<KR, V> toStream(
KeyValueMapper<? super K, ? super V, ? extends KR> mapper) |
|
KTable<K, VR> transformValues(
ValueTransformerWithKeySupplier<? super K, ? super V, ? extends VR> transformerSupplier,
Materialized<K, VR, KeyValueStore<Bytes, byte[]>> materialized,
String... stateStoreNames)
KTable<K, VR> transformValues(
ValueTransformerWithKeySupplier<? super K, ? super V, ? extends VR> transformerSupplier,
String... stateStoreNames) |