K
- The key by which state is keyed.public interface KeyedStateBackend<K>
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Closes the backend and releases all resources.
|
K |
getCurrentKey()
Used by states to access the current key.
|
int |
getCurrentKeyGroupIndex()
Returns the key-group to which the current key belongs.
|
KeyGroupsList |
getKeyGroupRange()
Returns the key groups for this backend.
|
TypeSerializer<K> |
getKeySerializer()
TypeSerializer for the state backend key type. |
int |
getNumberOfKeyGroups()
Returns the number of key-groups aka max parallelism.
|
<N,S extends State> |
getPartitionedState(N namespace,
TypeSerializer<N> namespaceSerializer,
StateDescriptor<S,?> stateDescriptor)
Creates or retrieves a partitioned state backed by this state backend.
|
<N,S extends MergingState<?,?>> |
mergePartitionedStates(N target,
Collection<N> sources,
TypeSerializer<N> namespaceSerializer,
StateDescriptor<S,?> stateDescriptor) |
void |
setCurrentKey(K newKey)
Sets the current key that is used for partitioned state.
|
void setCurrentKey(K newKey)
newKey
- The new current key.K getCurrentKey()
int getCurrentKeyGroupIndex()
int getNumberOfKeyGroups()
KeyGroupsList getKeyGroupRange()
TypeSerializer<K> getKeySerializer()
TypeSerializer
for the state backend key type.<N,S extends State> S getPartitionedState(N namespace, TypeSerializer<N> namespaceSerializer, StateDescriptor<S,?> stateDescriptor) throws Exception
N
- The type of the namespace.S
- The type of the state.stateDescriptor
- The identifier for the state. This contains name and can create a default state value.Exception
- Exceptions may occur during initialization of the state and should be forwarded.<N,S extends MergingState<?,?>> void mergePartitionedStates(N target, Collection<N> sources, TypeSerializer<N> namespaceSerializer, StateDescriptor<S,?> stateDescriptor) throws Exception
Exception
void dispose()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.