Class KeyPartitioner

  • All Implemented Interfaces:
    Partitioner, java.io.Serializable

    public class KeyPartitioner
    extends java.lang.Object
    implements Partitioner
    A partitioner based on key of entity. This is the default partitioner.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyPartitioner()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getPartitionId​(StreamElement element)
      Retrieve partition ID for the specified ingest.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeyPartitioner

        public KeyPartitioner()
    • Method Detail

      • getPartitionId

        public int getPartitionId​(StreamElement element)
        Description copied from interface: Partitioner
        Retrieve partition ID for the specified ingest. All ingests that have the same partition ID are guaranteed to be written to the same Kafka partition.
        Specified by:
        getPartitionId in interface Partitioner
        Parameters:
        element - element to calculate partition for
        Returns:
        ID of partition (can be negative)