T - the type of record which is sent through the attached output gatepublic class RoundRobinChannelSelector<T extends org.apache.flink.core.io.IOReadableWritable> extends Object implements ChannelSelector<T>
ChannelSelector interface. It represents a
simple round-robin strategy, i.e. regardless of the record every attached exactly one output
channel is selected at a time.| Constructor and Description |
|---|
RoundRobinChannelSelector() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isBroadcast()
Returns whether the channel selector always selects all the output channels.
|
int |
selectChannel(T record)
Returns the logical channel index, to which the given record should be written.
|
void |
setup(int numberOfChannels)
Initializes the channel selector with the number of output channels.
|
public void setup(int numberOfChannels)
ChannelSelectorsetup in interface ChannelSelector<T extends org.apache.flink.core.io.IOReadableWritable>numberOfChannels - the total number of output channels which are attached to respective
output gate.public int selectChannel(T record)
ChannelSelectorUnsupportedOperationException).selectChannel in interface ChannelSelector<T extends org.apache.flink.core.io.IOReadableWritable>record - the record to determine the output channels for.public boolean isBroadcast()
ChannelSelectorisBroadcast in interface ChannelSelector<T extends org.apache.flink.core.io.IOReadableWritable>Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.