Class WindowedStreamPartitioner<K,​V>

    • 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 interface StreamPartitioner<K,​V>
        Parameters:
        topic - the topic name this record is sent to
        windowedKey - the key of the record
        value - the value of the record
        numPartitions - the total number of partitions
        Returns:
        an integer between 0 and numPartitions-1, or null if the default partitioning logic should be used