Package org.apache.kafka.streams.kstream
Class Repartitioned<K,V>
java.lang.Object
org.apache.kafka.streams.kstream.Repartitioned<K,V>
- Type Parameters:
K
- key typeV
- value type
This class is used to provide the optional parameters for internal repartition topics.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> Repartitioned<K, V> Create aRepartitioned
instance with the provided name used as part of the repartition topic.static <K,
V> Repartitioned<K, V> numberOfPartitions
(int numberOfPartitions) Create aRepartitioned
instance with provided number of partitions for repartition topic.static <K,
V> Repartitioned<K, V> streamPartitioner
(StreamPartitioner<K, V> partitioner) Create aRepartitioned
instance with provided partitioner.static <K,
V> Repartitioned<K, V> Create aRepartitioned
instance with provided key serde and value serde.withKeySerde
(Serde<K> keySerde) Create a new instance ofRepartitioned
with the provided key serde.Create a new instance ofRepartitioned
with the provided name used as part of repartition topic and processor name.withNumberOfPartitions
(int numberOfPartitions) Create a new instance ofRepartitioned
with the provided number of partitions for repartition topic.withStreamPartitioner
(StreamPartitioner<K, V> partitioner) Create a new instance ofRepartitioned
with the provided partitioner.withValueSerde
(Serde<V> valueSerde) Create a new instance ofRepartitioned
with the provided value serde.
-
Method Details
-
as
Create aRepartitioned
instance with the provided name used as part of the repartition topic.- Type Parameters:
K
- key typeV
- value type- Parameters:
name
- the name used as a processor named and part of the repartition topic name.- Returns:
- A new
Repartitioned
instance configured with processor name and repartition topic name - See Also:
-
with
Create aRepartitioned
instance with provided key serde and value serde.- Type Parameters:
K
- key typeV
- value type- Parameters:
keySerde
- Serde to use for serializing the keyvalueSerde
- Serde to use for serializing the value- Returns:
- A new
Repartitioned
instance configured with key serde and value serde - See Also:
-
streamPartitioner
Create aRepartitioned
instance with provided partitioner.- Type Parameters:
K
- key typeV
- value type- Parameters:
partitioner
- the function used to determine how records are distributed among partitions of the topic, if not specified and the key serde provides aWindowedSerializer
for the keyWindowedStreamPartitioner
will be used—otherwiseDefaultStreamPartitioner
will be used- Returns:
- A new
Repartitioned
instance configured with partitioner - See Also:
-
numberOfPartitions
Create aRepartitioned
instance with provided number of partitions for repartition topic.- Type Parameters:
K
- key typeV
- value type- Parameters:
numberOfPartitions
- number of partitions used when creating repartition topic- Returns:
- A new
Repartitioned
instance configured number of partitions - See Also:
-
withName
Create a new instance ofRepartitioned
with the provided name used as part of repartition topic and processor name.- Parameters:
name
- the name used for the processor name and as part of the repartition topic- Returns:
- a new
Repartitioned
instance configured with the name
-
withNumberOfPartitions
Create a new instance ofRepartitioned
with the provided number of partitions for repartition topic.- Parameters:
numberOfPartitions
- the name used for the processor name and as part of the repartition topic name- Returns:
- a new
Repartitioned
instance configured with the number of partitions
-
withKeySerde
Create a new instance ofRepartitioned
with the provided key serde.- Parameters:
keySerde
- Serde to use for serializing the key- Returns:
- a new
Repartitioned
instance configured with the key serde
-
withValueSerde
Create a new instance ofRepartitioned
with the provided value serde.- Parameters:
valueSerde
- Serde to use for serializing the value- Returns:
- a new
Repartitioned
instance configured with the value serde
-
withStreamPartitioner
Create a new instance ofRepartitioned
with the provided partitioner.- Parameters:
partitioner
- the function used to determine how records are distributed among partitions of the topic, if not specified and the key serde provides aWindowedSerializer
for the keyWindowedStreamPartitioner
will be used—otherwiseDefaultStreamPartitioner
will be used- Returns:
- a new
Repartitioned
instance configured with provided partitioner
-