Class WindowedStreamPartitioner<K,V>
- java.lang.Object
-
- org.apache.kafka.streams.kstream.internals.WindowedStreamPartitioner<K,V>
-
- All Implemented Interfaces:
StreamPartitioner<Windowed<K>,V>
public class WindowedStreamPartitioner<K,V> extends Object implements StreamPartitioner<Windowed<K>,V>
-
-
Constructor Summary
Constructors Constructor Description WindowedStreamPartitioner(WindowedSerializer<K> serializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
partition(String topic, Windowed<K> windowedKey, V value, int numPartitions)
WindowedStreamPartitioner determines the partition number for a record with the given windowed key and value and the current number of partitions.
-
-
-
Constructor Detail
-
WindowedStreamPartitioner
public WindowedStreamPartitioner(WindowedSerializer<K> serializer)
-
-
Method Detail
-
partition
public Integer partition(String topic, Windowed<K> windowedKey, V value, int numPartitions)
WindowedStreamPartitioner determines the partition number for a record with the given windowed key and value and the current number of partitions. The partition number id determined by the original key of the windowed key using the same logic as DefaultPartitioner so that the topic is partitioned by the original key.- Specified by:
partition
in interfaceStreamPartitioner<K,V>
- Parameters:
topic
- the topic name this record is sent towindowedKey
- the key of the recordvalue
- the value of the recordnumPartitions
- the total number of partitions- Returns:
- an integer between 0 and
numPartitions-1
, ornull
if the default partitioning logic should be used
-
-