T - The type of the element handled by the emitter.public class OutputEmitter<T> extends Object implements ChannelSelector<SerializationDelegate<T>>
| Constructor and Description |
|---|
OutputEmitter(ShipStrategyType strategy,
int indexInSubtaskGroup)
Creates a new channel selector that uses the given strategy (broadcasting, partitioning, ...)
and uses the supplied task index perform a round robin distribution.
|
OutputEmitter(ShipStrategyType strategy,
int indexInSubtaskGroup,
org.apache.flink.api.common.typeutils.TypeComparator<T> comparator,
org.apache.flink.api.common.functions.Partitioner<?> partitioner,
org.apache.flink.api.common.distributions.DataDistribution distribution) |
OutputEmitter(ShipStrategyType strategy,
org.apache.flink.api.common.typeutils.TypeComparator<T> comparator)
Creates a new channel selector that uses the given strategy (broadcasting, partitioning, ...)
and uses the supplied comparator to hash / compare records for partitioning them deterministically.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isBroadcast()
Returns whether the channel selector always selects all the output channels.
|
int |
selectChannel(SerializationDelegate<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 OutputEmitter(ShipStrategyType strategy, int indexInSubtaskGroup)
strategy - The distribution strategy to be used.public OutputEmitter(ShipStrategyType strategy, org.apache.flink.api.common.typeutils.TypeComparator<T> comparator)
strategy - The distribution strategy to be used.comparator - The comparator used to hash / compare the records.public OutputEmitter(ShipStrategyType strategy, int indexInSubtaskGroup, org.apache.flink.api.common.typeutils.TypeComparator<T> comparator, org.apache.flink.api.common.functions.Partitioner<?> partitioner, org.apache.flink.api.common.distributions.DataDistribution distribution)
public void setup(int numberOfChannels)
ChannelSelectorsetup in interface ChannelSelector<SerializationDelegate<T>>numberOfChannels - the total number of output channels which are attached
to respective output gate.public final int selectChannel(SerializationDelegate<T> record)
ChannelSelectorUnsupportedOperationException).selectChannel in interface ChannelSelector<SerializationDelegate<T>>record - the record to determine the output channels for.public boolean isBroadcast()
ChannelSelectorisBroadcast in interface ChannelSelector<SerializationDelegate<T>>Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.