Interface Partitioner<K>

Type Parameters:
K - object type.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Partitioner<K>
Interface for mapping from an object to partition ID.
  • Method Summary

    Modifier and Type
    Method
    Description
    partition(K key, List<PartitionId> partitions)
    Returns the partition ID to which the specified object maps.
  • Method Details

    • partition

      PartitionId partition(K key, List<PartitionId> partitions)
      Returns the partition ID to which the specified object maps.
      Parameters:
      key - the key to partition
      partitions - the list of partitions
      Returns:
      partition identifier