Class RebalancePartitioner<T>

java.lang.Object
org.apache.flink.streaming.runtime.partitioner.StreamPartitioner<T>
org.apache.flink.streaming.runtime.partitioner.RebalancePartitioner<T>
Type Parameters:
T - Type of the elements in the Stream being rebalanced
All Implemented Interfaces:
Serializable, ChannelSelector<SerializationDelegate<StreamRecord<T>>>

@Internal public class RebalancePartitioner<T> extends StreamPartitioner<T>
Partitioner that distributes the data equally by cycling through the output channels.
See Also:
  • Constructor Details

    • RebalancePartitioner

      public RebalancePartitioner()
  • Method Details

    • setup

      public void setup(int numberOfChannels)
      Description copied from interface: ChannelSelector
      Initializes the channel selector with the number of output channels.
      Specified by:
      setup in interface ChannelSelector<T>
      Overrides:
      setup in class StreamPartitioner<T>
      Parameters:
      numberOfChannels - the total number of output channels which are attached to respective output gate.
    • selectChannel

      public int selectChannel(SerializationDelegate<StreamRecord<T>> record)
      Description copied from interface: ChannelSelector
      Returns the logical channel index, to which the given record should be written. It is illegal to call this method for broadcast channel selectors and this method can remain not implemented in that case (for example by throwing UnsupportedOperationException).
      Parameters:
      record - the record to determine the output channels for.
      Returns:
      an integer number which indicates the index of the output channel through which the record shall be forwarded.
    • getDownstreamSubtaskStateMapper

      public SubtaskStateMapper getDownstreamSubtaskStateMapper()
      Description copied from class: StreamPartitioner
      Defines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.
      Specified by:
      getDownstreamSubtaskStateMapper in class StreamPartitioner<T>
    • copy

      public StreamPartitioner<T> copy()
      Specified by:
      copy in class StreamPartitioner<T>
    • isPointwise

      public boolean isPointwise()
      Specified by:
      isPointwise in class StreamPartitioner<T>
    • toString

      public String toString()
      Overrides:
      toString in class Object