Class StateWithDeclaredNamespace<K,N,V>
java.lang.Object
org.apache.flink.runtime.asyncprocessing.declare.state.StateWithDeclaredNamespace<K,N,V>
- All Implemented Interfaces:
org.apache.flink.api.common.state.v2.State,InternalKeyedState<K,,N, V> InternalPartitionedState<N>
@Internal
public abstract class StateWithDeclaredNamespace<K,N,V>
extends Object
implements InternalKeyedState<K,N,V>
A partitioned state that wraps a declared namespace and hide the namespace switching from user.
User will only use the state just like the public state APIs without any consideration on
namespace.
This wrap class is useful in DataStream window operation, where namespace is managed by the operator and user function is free from namespace manipulation.
-
Constructor Summary
ConstructorsConstructorDescriptionStateWithDeclaredNamespace(InternalKeyedState<K, N, V> state, DeclaredVariable<N> declaredNamespace) -
Method Summary
Modifier and TypeMethodDescriptionstatic <N,S extends org.apache.flink.api.common.state.v2.State>
Screate(S state, DeclaredVariable<N> declaredNamespace) protected voidAutomatically called before any async state access.voidsetCurrentNamespace(N namespace) Set current namespace and access state under specified namespace afterward.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.api.common.state.v2.State
asyncClear, clear
-
Constructor Details
-
StateWithDeclaredNamespace
public StateWithDeclaredNamespace(@Nonnull InternalKeyedState<K, N, V> state, @Nonnull DeclaredVariable<N> declaredNamespace)
-
-
Method Details
-
setCurrentNamespace
Description copied from interface:InternalPartitionedStateSet current namespace and access state under specified namespace afterward.- Specified by:
setCurrentNamespacein interfaceInternalPartitionedState<K>- Parameters:
namespace- the specified namespace
-
resetNamespace
protected void resetNamespace()Automatically called before any async state access. -
create
public static <N,S extends org.apache.flink.api.common.state.v2.State> S create(S state, DeclaredVariable<N> declaredNamespace)
-