Interface Partitioner<K extends Serializable>

  • Type Parameters:
    K - the key type of the partition to write.
    All Known Implementing Classes:
    DedicatedKeyPerElementPartitioner, HashPartitioner, IntactPartitioner

    public interface Partitioner<K extends Serializable>
    This interface represents the way of partitioning output data from a source task. It takes an element and designates key of partition to write the element, according to the number of destination tasks, the key of each element, etc.
    • Method Detail

      • partition

        K partition​(Object element)
        Divides the output data from a task into multiple blocks.
        Parameters:
        element - the output element from a source task.
        Returns:
        the key of the partition in the block to write the element.