Class RescalePartitioner<T>
- Type Parameters:
T- Type of the elements in the Stream being rescaled
- All Implemented Interfaces:
Serializable,ChannelSelector<SerializationDelegate<StreamRecord<T>>>
StreamingJobGraphGenerator instantiates a DistributionPattern.POINTWISE distribution pattern when encountering RescalePartitioner.
The subset of downstream operations to which the upstream operation sends elements depends on the degree of parallelism of both the upstream and downstream operation. For example, if the upstream operation has parallelism 2 and the downstream operation has parallelism 4, then one upstream operation would distribute elements to two downstream operations while the other upstream operation would distribute to the other two downstream operations. If, on the other hand, the downstream operation has parallelism 2 while the upstream operation has parallelism 4 then two upstream operations will distribute to one downstream operation while the other two upstream operations will distribute to the other downstream operations.
In cases where the different parallelisms are not multiples of each other one or several downstream operations will have a differing number of inputs from upstream operations.
- See Also:
-
Field Summary
Fields inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
numberOfChannels -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Defines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.Defines the behavior of this partitioner, when upstream rescaled during recovery of in-flight data.booleanintselectChannel(SerializationDelegate<StreamRecord<T>> record) Returns the logical channel index, to which the given record should be written.toString()Methods inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
disableUnalignedCheckpoints, equals, hashCode, isBroadcast, isSupportsUnalignedCheckpoint, setup
-
Constructor Details
-
RescalePartitioner
public RescalePartitioner()
-
-
Method Details
-
selectChannel
Description copied from interface:ChannelSelectorReturns 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 throwingUnsupportedOperationException).- 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
Description copied from class:StreamPartitionerDefines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.- Specified by:
getDownstreamSubtaskStateMapperin classStreamPartitioner<T>
-
getUpstreamSubtaskStateMapper
Description copied from class:StreamPartitionerDefines the behavior of this partitioner, when upstream rescaled during recovery of in-flight data.- Overrides:
getUpstreamSubtaskStateMapperin classStreamPartitioner<T>
-
copy
- Specified by:
copyin classStreamPartitioner<T>
-
toString
-
isPointwise
public boolean isPointwise()- Specified by:
isPointwisein classStreamPartitioner<T>
-