Class DedicatedKeyPerElementPartitioner

  • All Implemented Interfaces:
    Partitioner<Integer>

    @DedicatedKeyPerElement
    public final class DedicatedKeyPerElementPartitioner
    extends Object
    implements Partitioner<Integer>
    An implementation of Partitioner which assigns a dedicated key per an output data from a task. WARNING: Because this partitioner assigns a dedicated key per element, it should be used under specific circumstances that the number of output element is not that many. For example, every output element of StreamTransform inserted by large shuffle optimization is always a partition. In this case, assigning a key for each element can be useful.
    • Constructor Detail

      • DedicatedKeyPerElementPartitioner

        public DedicatedKeyPerElementPartitioner()
        Constructor.
    • Method Detail

      • partition

        public Integer partition​(Object element)
        Description copied from interface: Partitioner
        Divides the output data from a task into multiple blocks.
        Specified by:
        partition in interface Partitioner<Integer>
        Parameters:
        element - the output element from a source task.
        Returns:
        the key of the partition in the block to write the element.