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 Details

  • Method Details

    • setCurrentNamespace

      public void setCurrentNamespace(N namespace)
      Description copied from interface: InternalPartitionedState
      Set current namespace and access state under specified namespace afterward.
      Specified by:
      setCurrentNamespace in interface InternalPartitionedState<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)