K
- the key typeV
- the value typepublic class Grouped<K,V> extends 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 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(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(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(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.
|
protected final String name
public static <K,V> Grouped<K,V> as(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(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(String name)
name
- the name used for the processor name and as part of the repartition topic name if requiredGrouped
instance configured with the namepublic Grouped<K,V> withKeySerde(Serde<K> keySerde)