Package org.apache.flink.runtime.state
Class InternalKeyContextImpl<K>
- java.lang.Object
-
- org.apache.flink.runtime.state.InternalKeyContextImpl<K>
-
- Type Parameters:
K- Type of the key.
- All Implemented Interfaces:
InternalKeyContext<K>
public class InternalKeyContextImpl<K> extends Object implements InternalKeyContext<K>
The defaultInternalKeyContextimplementation.
-
-
Constructor Summary
Constructors Constructor Description InternalKeyContextImpl(KeyGroupRange keyGroupRange, int numberOfKeyGroups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KgetCurrentKey()Used by states to access the current key.intgetCurrentKeyGroupIndex()Returns the key-group to which the current key belongs.KeyGroupRangegetKeyGroupRange()Returns the key groups for this backend.intgetNumberOfKeyGroups()Returns the number of key-groups aka max parallelism.voidsetCurrentKey(K currentKey)Set current key of the context.voidsetCurrentKeyGroupIndex(int currentKeyGroupIndex)Set current key group index of the context.
-
-
-
Constructor Detail
-
InternalKeyContextImpl
public InternalKeyContextImpl(@Nonnull KeyGroupRange keyGroupRange, @Nonnegative int numberOfKeyGroups)
-
-
Method Detail
-
getCurrentKey
public K getCurrentKey()
Description copied from interface:InternalKeyContextUsed by states to access the current key.- Specified by:
getCurrentKeyin interfaceInternalKeyContext<K>
-
getCurrentKeyGroupIndex
public int getCurrentKeyGroupIndex()
Description copied from interface:InternalKeyContextReturns the key-group to which the current key belongs.- Specified by:
getCurrentKeyGroupIndexin interfaceInternalKeyContext<K>
-
getNumberOfKeyGroups
public int getNumberOfKeyGroups()
Description copied from interface:InternalKeyContextReturns the number of key-groups aka max parallelism.- Specified by:
getNumberOfKeyGroupsin interfaceInternalKeyContext<K>
-
getKeyGroupRange
public KeyGroupRange getKeyGroupRange()
Description copied from interface:InternalKeyContextReturns the key groups for this backend.- Specified by:
getKeyGroupRangein interfaceInternalKeyContext<K>
-
setCurrentKey
public void setCurrentKey(@Nonnull K currentKey)Description copied from interface:InternalKeyContextSet current key of the context.- Specified by:
setCurrentKeyin interfaceInternalKeyContext<K>- Parameters:
currentKey- the current key to set to.
-
setCurrentKeyGroupIndex
public void setCurrentKeyGroupIndex(int currentKeyGroupIndex)
Description copied from interface:InternalKeyContextSet current key group index of the context.- Specified by:
setCurrentKeyGroupIndexin interfaceInternalKeyContext<K>- Parameters:
currentKeyGroupIndex- the current key group index to set to.
-
-