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(KeySelector<T,K> keySelector, int maxParallelism)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(int maxParallelism)
Configure theStreamPartitioner
with the maximum parallelism of the down stream operator.StreamPartitioner<T>
copy()
boolean
equals(Object o)
SubtaskStateMapper
getDownstreamSubtaskStateMapper()
Defines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.int
getMaxParallelism()
int
hashCode()
boolean
isPointwise()
int
selectChannel(SerializationDelegate<StreamRecord<T>> record)
Returns the logical channel index, to which the given record should be written.String
toString()
-
Methods inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
disableUnalignedCheckpoints, getUpstreamSubtaskStateMapper, isBroadcast, isSupportsUnalignedCheckpoint, setup
-
-
-
-
Constructor Detail
-
KeyGroupStreamPartitioner
public KeyGroupStreamPartitioner(KeySelector<T,K> keySelector, int maxParallelism)
-
-
Method Detail
-
getMaxParallelism
public int getMaxParallelism()
-
selectChannel
public int selectChannel(SerializationDelegate<StreamRecord<T>> record)
Description copied from interface:ChannelSelector
Returns 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:
selectChannel
in 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:StreamPartitioner
Defines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.- Specified by:
getDownstreamSubtaskStateMapper
in classStreamPartitioner<T>
-
copy
public StreamPartitioner<T> copy()
- Specified by:
copy
in classStreamPartitioner<T>
-
isPointwise
public boolean isPointwise()
- Specified by:
isPointwise
in classStreamPartitioner<T>
-
configure
public void configure(int maxParallelism)
Description copied from interface:ConfigurableStreamPartitioner
Configure theStreamPartitioner
with the maximum parallelism of the down stream operator.- Specified by:
configure
in interfaceConfigurableStreamPartitioner
- Parameters:
maxParallelism
- Maximum parallelism of the down stream operator.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classStreamPartitioner<T>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classStreamPartitioner<T>
-
-