Class KeyGroupStreamPartitioner<T,K>
- java.lang.Object
-
- org.apache.flink.streaming.runtime.partitioner.StreamPartitioner<T>
-
- org.apache.flink.streaming.runtime.partitioner.KeyGroupStreamPartitioner<T,K>
-
- Type Parameters:
T- Type of the elements in the Stream being partitioned
- All Implemented Interfaces:
Serializable,ChannelSelector<SerializationDelegate<StreamRecord<T>>>,ConfigurableStreamPartitioner
@Internal public class KeyGroupStreamPartitioner<T,K> extends StreamPartitioner<T> implements ConfigurableStreamPartitioner
Partitioner selects the target channel based on the key group index.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
numberOfChannels
-
-
Constructor Summary
Constructors Constructor Description KeyGroupStreamPartitioner(org.apache.flink.api.java.functions.KeySelector<T,K> keySelector, int maxParallelism)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(int maxParallelism)Configure theStreamPartitionerwith the maximum parallelism of the down stream operator.StreamPartitioner<T>copy()booleanequals(Object o)SubtaskStateMappergetDownstreamSubtaskStateMapper()Defines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.intgetMaxParallelism()inthashCode()booleanisPointwise()intselectChannel(SerializationDelegate<StreamRecord<T>> record)Returns the logical channel index, to which the given record should be written.StringtoString()-
Methods inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
disableUnalignedCheckpoints, getUpstreamSubtaskStateMapper, isBroadcast, isSupportsUnalignedCheckpoint, setup
-
-
-
-
Method Detail
-
getMaxParallelism
public int getMaxParallelism()
-
selectChannel
public int selectChannel(SerializationDelegate<StreamRecord<T>> record)
Description copied from interface:ChannelSelectorReturns the logical channel index, to which the given record should be written. It is illegal to call this method for broadcast channel selectors and this method can remain not implemented in that case (for example by throwingUnsupportedOperationException).- Specified by:
selectChannelin interfaceChannelSelector<T>- 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.
-
getDownstreamSubtaskStateMapper
public SubtaskStateMapper getDownstreamSubtaskStateMapper()
Description copied from class:StreamPartitionerDefines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.- Specified by:
getDownstreamSubtaskStateMapperin classStreamPartitioner<T>
-
copy
public StreamPartitioner<T> copy()
- Specified by:
copyin classStreamPartitioner<T>
-
isPointwise
public boolean isPointwise()
- Specified by:
isPointwisein classStreamPartitioner<T>
-
configure
public void configure(int maxParallelism)
Description copied from interface:ConfigurableStreamPartitionerConfigure theStreamPartitionerwith the maximum parallelism of the down stream operator.- Specified by:
configurein interfaceConfigurableStreamPartitioner- Parameters:
maxParallelism- Maximum parallelism of the down stream operator.
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classStreamPartitioner<T>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classStreamPartitioner<T>
-
-