T
- the type of record which is sent through the attached output gatepublic class RoundRobinChannelSelector<T extends 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)
ChannelSelector
setup
in interface ChannelSelector<T extends IOReadableWritable>
numberOfChannels
- the total number of output channels which are attached to respective
output gate.public int selectChannel(T record)
ChannelSelector
UnsupportedOperationException
).selectChannel
in interface ChannelSelector<T extends IOReadableWritable>
record
- the record to determine the output channels for.public boolean isBroadcast()
ChannelSelector
isBroadcast
in interface ChannelSelector<T extends IOReadableWritable>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.