Class BroadcastPartitioner<T>
java.lang.Object
org.apache.flink.streaming.runtime.partitioner.StreamPartitioner<T>
org.apache.flink.streaming.runtime.partitioner.BroadcastPartitioner<T>
- Type Parameters:
T- Type of the elements in the Stream being broadcast
- All Implemented Interfaces:
Serializable,ChannelSelector<SerializationDelegate<StreamRecord<T>>>
Partitioner that selects all the output channels.
- 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.booleanReturns whether the channel selector always selects all the output channels.booleanintselectChannel(SerializationDelegate<StreamRecord<T>> record) Note: Broadcast mode could be handled directly for all the output channels in record writer, so it is no need to select channels via this method.toString()Methods inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
disableUnalignedCheckpoints, equals, hashCode, isSupportsUnalignedCheckpoint, setup
-
Constructor Details
-
BroadcastPartitioner
public BroadcastPartitioner()
-
-
Method Details
-
selectChannel
Note: Broadcast mode could be handled directly for all the output channels in record writer, so it is no need to select channels via this method.- 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.
-
getUpstreamSubtaskStateMapper
Description copied from class:StreamPartitionerDefines the behavior of this partitioner, when upstream rescaled during recovery of in-flight data.- Overrides:
getUpstreamSubtaskStateMapperin classStreamPartitioner<T>
-
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>
-
isBroadcast
public boolean isBroadcast()Description copied from interface:ChannelSelectorReturns whether the channel selector always selects all the output channels.- Specified by:
isBroadcastin interfaceChannelSelector<T>- Overrides:
isBroadcastin classStreamPartitioner<T>- Returns:
- true if the selector is for broadcast mode.
-
copy
- Specified by:
copyin classStreamPartitioner<T>
-
isPointwise
public boolean isPointwise()- Specified by:
isPointwisein classStreamPartitioner<T>
-
toString
-