Class CustomPartitionerWrapper<K,T>
- java.lang.Object
-
- org.apache.flink.streaming.runtime.partitioner.StreamPartitioner<T>
-
- org.apache.flink.streaming.runtime.partitioner.CustomPartitionerWrapper<K,T>
-
- Type Parameters:
K- Type of the keyT- Type of the data
- All Implemented Interfaces:
Serializable,ChannelSelector<SerializationDelegate<StreamRecord<T>>>
@Internal public class CustomPartitionerWrapper<K,T> extends StreamPartitioner<T>
Partitioner that selects the channel with a user defined partitioner function on a key.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.runtime.partitioner.StreamPartitioner
numberOfChannels
-
-
Constructor Summary
Constructors Constructor Description CustomPartitionerWrapper(org.apache.flink.api.common.functions.Partitioner<K> partitioner, org.apache.flink.api.java.functions.KeySelector<T,K> keySelector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamPartitioner<T>copy()booleanequals(Object o)SubtaskStateMappergetDownstreamSubtaskStateMapper()Defines the behavior of this partitioner, when downstream rescaled during recovery of in-flight data.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
-
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).- 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>
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classStreamPartitioner<T>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classStreamPartitioner<T>
-
isPointwise
public boolean isPointwise()
- Specified by:
isPointwisein classStreamPartitioner<T>
-
-