Package org.apache.flink.runtime.state
Interface InternalKeyContext<K>
-
- All Known Implementing Classes:
AbstractKeyedStateBackend,HeapKeyedStateBackend,InternalKeyContextImpl
@Internal public interface InternalKeyContext<K>This interface is the current context of a keyed state. It provides information about the currently selected key in the context, the corresponding key-group, and other key and key-grouping related information.The typical use case for this interface is providing a view on the current-key selection aspects of
KeyedStateBackend.
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
getCurrentKey
K getCurrentKey()
Used by states to access the current key.
-
getCurrentKeyGroupIndex
int getCurrentKeyGroupIndex()
Returns the key-group to which the current key belongs.
-
getNumberOfKeyGroups
int getNumberOfKeyGroups()
Returns the number of key-groups aka max parallelism.
-
getKeyGroupRange
KeyGroupRange getKeyGroupRange()
Returns the key groups for this backend.
-
setCurrentKey
void setCurrentKey(@Nonnull K currentKey)Set current key of the context.- Parameters:
currentKey- the current key to set to.
-
setCurrentKeyGroupIndex
void setCurrentKeyGroupIndex(int currentKeyGroupIndex)
Set current key group index of the context.- Parameters:
currentKeyGroupIndex- the current key group index to set to.
-
-