Class DefaultStreamPartitioner<K,​V>

    • Constructor Detail

      • DefaultStreamPartitioner

        public DefaultStreamPartitioner​(Serializer<K> keySerializer,
                                        Cluster cluster)
    • Method Detail

      • partition

        public Integer partition​(String topic,
                                 K key,
                                 V value,
                                 int numPartitions)
        Description copied from interface: StreamPartitioner
        Determine the partition number for a record with the given key and value and the current number of partitions.
        Specified by:
        partition in interface StreamPartitioner<K,​V>
        Parameters:
        topic - the topic name this record is sent to
        key - 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