K
- the key typeV
- the value typepublic class Grouped<K,V>
extends java.lang.Object
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.Modifier and Type | Field and Description |
---|---|
protected Serde<K> |
keySerde |
protected java.lang.String |
name |
protected Serde<V> |
valueSerde |
Modifier | Constructor and Description |
---|---|
protected |
Grouped(Grouped<K,V> grouped) |
Modifier and Type | Method and Description |
---|---|
static <K,V> Grouped<K,V> |
as(java.lang.String name)
Create a
Grouped instance with the provided name used as part of the repartition topic if required. |
static <K> Grouped |
keySerde(Serde<K> keySerde)
Create a
Grouped instance with the provided keySerde. |
static <V> Grouped |
valueSerde(Serde<V> valueSerde)
Create a
Grouped instance with the provided valueSerde. |
static <K,V> Grouped<K,V> |
with(Serde<K> keySerde,
Serde<V> valueSerde)
Create a
Grouped instance with the provided keySerde and valueSerde. |
static <K,V> Grouped<K,V> |
with(java.lang.String name,
Serde<K> keySerde,
Serde<V> valueSerde)
Create a
Grouped instance with the provided name, keySerde, and valueSerde. |
Grouped<K,V> |
withKeySerde(Serde<K> keySerde)
Perform the grouping operation using the provided keySerde for serializing the key.
|
Grouped<K,V> |
withName(java.lang.String name)
Perform the grouping operation with the name for a repartition topic if required.
|
Grouped<K,V> |
withValueSerde(Serde<V> valueSerde)
Perform the grouping operation using the provided valueSerde for serializing the value.
|
public static <K,V> Grouped<K,V> as(java.lang.String name)
Grouped
instance with the provided name used as part of the repartition topic if required.name
- the name used for a repartition topic if requiredGrouped
configured with the nameKStream.groupByKey(Grouped)
,
KStream.groupBy(KeyValueMapper, Grouped)
,
KTable.groupBy(KeyValueMapper, Grouped)
public static <K> Grouped keySerde(Serde<K> keySerde)
Grouped
instance with the provided keySerde. If null
the default key serde from config will be used.keySerde
- the Serde used for serializing the key. If null
the default key serde from config will be usedGrouped
configured with the keySerdeKStream.groupByKey(Grouped)
,
KStream.groupBy(KeyValueMapper, Grouped)
,
KTable.groupBy(KeyValueMapper, Grouped)
public static <V> Grouped valueSerde(Serde<V> valueSerde)
Grouped
instance with the provided valueSerde. If null
the default value serde from config will be used.valueSerde
- the Serde
used for serializing the value. If null
the default value serde from config will be usedGrouped
configured with the valueSerdeKStream.groupByKey(Grouped)
,
KStream.groupBy(KeyValueMapper, Grouped)
,
KTable.groupBy(KeyValueMapper, Grouped)
public static <K,V> Grouped<K,V> with(java.lang.String name, Serde<K> keySerde, Serde<V> valueSerde)
Grouped
instance with the provided name, keySerde, and valueSerde. If the keySerde and/or the valueSerde is
null
the default value for the respective serde from config will be used.name
- the name used as part of the repartition topic name if requiredkeySerde
- the Serde
used for serializing the key. If null
the default key serde from config will be usedvalueSerde
- the Serde
used for serializing the value. If null
the default value serde from config will be usedGrouped
configured with the name, keySerde, and valueSerdeKStream.groupByKey(Grouped)
,
KStream.groupBy(KeyValueMapper, Grouped)
,
KTable.groupBy(KeyValueMapper, Grouped)
public static <K,V> Grouped<K,V> with(Serde<K> keySerde, Serde<V> valueSerde)
Grouped
instance with the provided keySerde and valueSerde. If the keySerde and/or the valueSerde is
null
the default value for the respective serde from config will be used.keySerde
- the Serde
used for serializing the key. If null
the default key serde from config will be usedvalueSerde
- the Serde
used for serializing the value. If null
the default value serde from config will be usedGrouped
configured with the keySerde, and valueSerdeKStream.groupByKey(Grouped)
,
KStream.groupBy(KeyValueMapper, Grouped)
,
KTable.groupBy(KeyValueMapper, Grouped)
public Grouped<K,V> withName(java.lang.String name)
name
- the name used as part of the repartition topic name if requiredGrouped
instance configured with the namepublic Grouped<K,V> withKeySerde(Serde<K> keySerde)