Package org.apache.kafka.streams.kstream
Class Grouped<K,V>
java.lang.Object
org.apache.kafka.streams.kstream.Grouped<K,V>
- Type Parameters:
K
- the key typeV
- the value type
The class that is used to capture the key and value
Serde
s and set the part of name used for
repartition topics when performing KStream.groupBy(KeyValueMapper, Grouped)
, KStream.groupByKey(Grouped)
, or KTable.groupBy(KeyValueMapper, Grouped)
operations. Note
that Kafka Streams does not always create repartition topics for grouping operations.-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> Grouped<K, V> Create aGrouped
instance with the provided name used as part of the repartition topic if required.static <K,
V> Grouped<K, V> Create aGrouped
instance with the provided keySerde.static <K,
V> Grouped<K, V> valueSerde
(Serde<V> valueSerde) Create aGrouped
instance with the provided valueSerde.static <K,
V> Grouped<K, V> Create aGrouped
instance with the provided name, keySerde, and valueSerde.static <K,
V> Grouped<K, V> Create aGrouped
instance with the provided keySerde and valueSerde.withKeySerde
(Serde<K> keySerde) Perform the grouping operation using the provided keySerde for serializing the key.Perform the grouping operation with the name for a repartition topic if required.withValueSerde
(Serde<V> valueSerde) Perform the grouping operation using the provided valueSerde for serializing the value.
-
Method Details
-
as
Create aGrouped
instance with the provided name used as part of the repartition topic if required.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name used for a repartition topic if required- Returns:
- a new
Grouped
configured with the name - See Also:
-
keySerde
Create aGrouped
instance with the provided keySerde. Ifnull
the default key serde from config will be used.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
keySerde
- the Serde used for serializing the key. Ifnull
the default key serde from config will be used- Returns:
- a new
Grouped
configured with the keySerde - See Also:
-
valueSerde
Create aGrouped
instance with the provided valueSerde. Ifnull
the default value serde from config will be used. -
with
Create aGrouped
instance with the provided name, keySerde, and valueSerde. If the keySerde and/or the valueSerde isnull
the default value for the respective serde from config will be used.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
name
- the name used as part of the repartition topic name if requiredkeySerde
- theSerde
used for serializing the key. Ifnull
the default key serde from config will be usedvalueSerde
- theSerde
used for serializing the value. Ifnull
the default value serde from config will be used- Returns:
- a new
Grouped
configured with the name, keySerde, and valueSerde - See Also:
-
with
Create aGrouped
instance with the provided keySerde and valueSerde. If the keySerde and/or the valueSerde isnull
the default value for the respective serde from config will be used.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
keySerde
- theSerde
used for serializing the key. Ifnull
the default key serde from config will be usedvalueSerde
- theSerde
used for serializing the value. Ifnull
the default value serde from config will be used- Returns:
- a new
Grouped
configured with the keySerde, and valueSerde - See Also:
-
withName
Perform the grouping operation with the name for a repartition topic if required. Note that Kafka Streams does not always create repartition topics for grouping operations.- Parameters:
name
- the name used for the processor name and as part of the repartition topic name if required- Returns:
- a new
Grouped
instance configured with the name
-
withKeySerde
Perform the grouping operation using the provided keySerde for serializing the key. -
withValueSerde
Perform the grouping operation using the provided valueSerde for serializing the value.
-