K - The key by which state is keyed.public interface KeyedStateBackend<K> extends InternalKeyContext<K>, KeyedStateFactory, PriorityQueueSetFactory, org.apache.flink.util.Disposable
| Modifier and Type | Method and Description |
|---|---|
<N,S extends org.apache.flink.api.common.state.State,T> |
applyToAllKeys(N namespace,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.StateDescriptor<S,T> stateDescriptor,
KeyedStateFunction<K,S> function)
Applies the provided
KeyedStateFunction to the state with the provided
StateDescriptor of all the currently active keys. |
void |
dispose() |
<N> java.util.stream.Stream<K> |
getKeys(String state,
N namespace) |
<N,S extends org.apache.flink.api.common.state.State,T> |
getOrCreateKeyedState(org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.StateDescriptor<S,T> stateDescriptor)
Creates or retrieves a keyed state backed by this state backend.
|
<N,S extends org.apache.flink.api.common.state.State> |
getPartitionedState(N namespace,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.StateDescriptor<S,?> stateDescriptor)
Creates or retrieves a partitioned state backed by this state backend.
|
void |
setCurrentKey(K newKey)
Sets the current key that is used for partitioned state.
|
getCurrentKey, getCurrentKeyGroupIndex, getKeyGroupRange, getKeySerializer, getNumberOfKeyGroupscreateInternalState, createInternalStatecreatevoid setCurrentKey(K newKey)
newKey - The new current key.<N,S extends org.apache.flink.api.common.state.State,T> void applyToAllKeys(N namespace,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.StateDescriptor<S,T> stateDescriptor,
KeyedStateFunction<K,S> function)
throws Exception
KeyedStateFunction to the state with the provided
StateDescriptor of all the currently active keys.N - The type of the namespace.S - The type of the state.namespace - the namespace of the state.namespaceSerializer - the serializer for the namespace.stateDescriptor - the descriptor of the state to which the function is going to be applied.function - the function to be applied to the keyed state.Exception<N> java.util.stream.Stream<K> getKeys(String state, N namespace)
state - State variable for which existing keys will be returned.namespace - Namespace for which existing keys will be returned.<N,S extends org.apache.flink.api.common.state.State,T> S getOrCreateKeyedState(org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.StateDescriptor<S,T> stateDescriptor)
throws Exception
N - The type of the namespace.S - The type of the state.namespaceSerializer - The serializer used for the namespace type of the statestateDescriptor - 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 org.apache.flink.api.common.state.State> S getPartitionedState(N namespace,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.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.void dispose()
dispose in interface org.apache.flink.util.DisposableCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.