public class OutputEmitter<T> extends Object implements ChannelSelector<SerializationDelegate<T>>
| Constructor and Description |
|---|
OutputEmitter()
Creates a new channel selector that distributes data round robin.
|
OutputEmitter(ShipStrategyType strategy)
Creates a new channel selector that uses the given strategy (broadcasting, partitioning, ...).
|
OutputEmitter(ShipStrategyType strategy,
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.
|
OutputEmitter(ShipStrategyType strategy,
TypeComparator<T> comparator,
DataDistribution distr)
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 |
|---|---|
int[] |
selectChannels(SerializationDelegate<T> record,
int numberOfChannels)
Called to determine to which attached
OutputChannel objects the given record shall be forwarded. |
public OutputEmitter()
public OutputEmitter(ShipStrategyType strategy)
strategy - The distribution strategy to be used.public OutputEmitter(ShipStrategyType strategy, TypeComparator<T> comparator)
strategy - The distribution strategy to be used.comparator - The comparator used to hash / compare the records.public OutputEmitter(ShipStrategyType strategy, TypeComparator<T> comparator, DataDistribution distr)
strategy - The distribution strategy to be used.comparator - The comparator used to hash / compare the records.distr - The distribution pattern used in the case of a range partitioning.public final int[] selectChannels(SerializationDelegate<T> record, int numberOfChannels)
ChannelSelectorOutputChannel objects the given record shall be forwarded.selectChannels in interface ChannelSelector<SerializationDelegate<T>>record - the record to the determine the output channels fornumberOfChannels - the total number of output channels which are attached to respective output gateCopyright © 2014 The Apache Software Foundation. All rights reserved.