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 defaultInternalKeyContext
implementation.
-
-
Constructor Summary
Constructors Constructor Description InternalKeyContextImpl(KeyGroupRange keyGroupRange, int numberOfKeyGroups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description K
getCurrentKey()
Used by states to access the current key.int
getCurrentKeyGroupIndex()
Returns the key-group to which the current key belongs.KeyGroupRange
getKeyGroupRange()
Returns the key groups for this backend.int
getNumberOfKeyGroups()
Returns the number of key-groups aka max parallelism.void
setCurrentKey(K currentKey)
Set current key of the context.void
setCurrentKeyGroupIndex(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:InternalKeyContext
Used by states to access the current key.- Specified by:
getCurrentKey
in interfaceInternalKeyContext<K>
-
getCurrentKeyGroupIndex
public int getCurrentKeyGroupIndex()
Description copied from interface:InternalKeyContext
Returns the key-group to which the current key belongs.- Specified by:
getCurrentKeyGroupIndex
in interfaceInternalKeyContext<K>
-
getNumberOfKeyGroups
public int getNumberOfKeyGroups()
Description copied from interface:InternalKeyContext
Returns the number of key-groups aka max parallelism.- Specified by:
getNumberOfKeyGroups
in interfaceInternalKeyContext<K>
-
getKeyGroupRange
public KeyGroupRange getKeyGroupRange()
Description copied from interface:InternalKeyContext
Returns the key groups for this backend.- Specified by:
getKeyGroupRange
in interfaceInternalKeyContext<K>
-
setCurrentKey
public void setCurrentKey(@Nonnull K currentKey)
Description copied from interface:InternalKeyContext
Set current key of the context.- Specified by:
setCurrentKey
in interfaceInternalKeyContext<K>
- Parameters:
currentKey
- the current key to set to.
-
setCurrentKeyGroupIndex
public void setCurrentKeyGroupIndex(int currentKeyGroupIndex)
Description copied from interface:InternalKeyContext
Set current key group index of the context.- Specified by:
setCurrentKeyGroupIndex
in interfaceInternalKeyContext<K>
- Parameters:
currentKeyGroupIndex
- the current key group index to set to.
-
-