Interface Partitioner<K>

Type Parameters:
K - object type.
All Known Implementing Classes:
Murmur3Partitioner
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.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static Partitioner<String> MURMUR3
    Murmur 3 partitioner.
  • Method Summary

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

  • 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