public class WindowedStreamPartitioner<K,V> extends java.lang.Object implements StreamPartitioner<Windowed<K>,V>
Constructor and Description |
---|
WindowedStreamPartitioner(WindowedSerializer<K> serializer) |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
partition(java.lang.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.
|
public WindowedStreamPartitioner(WindowedSerializer<K> serializer)
public java.lang.Integer partition(java.lang.String topic, Windowed<K> windowedKey, V value, int numPartitions)
partition
in interface StreamPartitioner<Windowed<K>,V>
topic
- the topic name this record is sent towindowedKey
- the key of the recordvalue
- the value of the recordnumPartitions
- the total number of partitionsnumPartitions-1
, or null
if the default partitioning logic should be used