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>>>
@Internal public class BroadcastPartitioner<T> extends StreamPartitioner<T>
Partitioner that selects all the output channels.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
numberOfChannels
-
-
Constructor Summary
Constructors Constructor Description BroadcastPartitioner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamPartitioner<T>
copy()
SubtaskStateMapper
getDownstreamSubtaskStateMapper()
Defines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.SubtaskStateMapper
getUpstreamSubtaskStateMapper()
Defines the behavior of this partitioner, when upstream rescaled during recovery of in-flight data.boolean
isBroadcast()
Returns whether the channel selector always selects all the output channels.boolean
isPointwise()
int
selectChannel(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.String
toString()
-
Methods inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
disableUnalignedCheckpoints, equals, hashCode, isSupportsUnalignedCheckpoint, setup
-
-
-
-
Method Detail
-
selectChannel
public int selectChannel(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.- 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
public SubtaskStateMapper getUpstreamSubtaskStateMapper()
Description copied from class:StreamPartitioner
Defines the behavior of this partitioner, when upstream rescaled during recovery of in-flight data.- Overrides:
getUpstreamSubtaskStateMapper
in classStreamPartitioner<T>
-
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 classStreamPartitioner<T>
-
isBroadcast
public boolean isBroadcast()
Description copied from interface:ChannelSelector
Returns whether the channel selector always selects all the output channels.- Specified by:
isBroadcast
in interfaceChannelSelector<T>
- Overrides:
isBroadcast
in classStreamPartitioner<T>
- Returns:
- true if the selector is for broadcast mode.
-
copy
public StreamPartitioner<T> copy()
- Specified by:
copy
in classStreamPartitioner<T>
-
isPointwise
public boolean isPointwise()
- Specified by:
isPointwise
in classStreamPartitioner<T>
-
-