Interface AsyncKeyedStateBackend<K>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      <N,​S extends org.apache.flink.api.common.state.v2.State,​SV>
      S
      createState​(N defaultNamespace, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, StateDescriptor<SV> stateDesc)
      Creates and returns a new state.
      StateExecutor createStateExecutor()
      Creates a StateExecutor which supports to execute a batch of state requests asynchronously.
      void dispose()  
      void setup​(StateRequestHandler stateRequestHandler)
      Initializes with some contexts.
      default void switchContext​(RecordContext<K> context)
      By default, a state backend does nothing when a key is switched in async processing.
      • Methods inherited from interface org.apache.flink.api.common.state.CheckpointListener

        notifyCheckpointAborted, notifyCheckpointComplete
      • Methods inherited from interface org.apache.flink.api.common.state.InternalCheckpointListener

        notifyCheckpointSubsumed
    • Method Detail

      • setup

        void setup​(@Nonnull
                   StateRequestHandler stateRequestHandler)
        Initializes with some contexts.
        Parameters:
        stateRequestHandler - which handles state request.
      • createState

        @Nonnull
        <N,​S extends org.apache.flink.api.common.state.v2.State,​SV> S createState​(@Nonnull
                                                                                              N defaultNamespace,
                                                                                              @Nonnull
                                                                                              org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
                                                                                              @Nonnull
                                                                                              StateDescriptor<SV> stateDesc)
                                                                                       throws Exception
        Creates and returns a new state.
        Type Parameters:
        N - the type of namespace for partitioning.
        S - The type of the public API state.
        SV - The type of the stored state value.
        Parameters:
        defaultNamespace - the default namespace for this state.
        namespaceSerializer - the serializer for namespace.
        stateDesc - The StateDescriptor that contains the name of the state.
        Throws:
        Exception - Exceptions may occur during initialization of the state.
      • createStateExecutor

        @Nonnull
        StateExecutor createStateExecutor()
        Creates a StateExecutor which supports to execute a batch of state requests asynchronously.

        Notice that the AsyncKeyedStateBackend is responsible for shutting down the StateExecutors created by itself when they are no longer in use.

        Returns:
        a StateExecutor which supports to execute a batch of state requests asynchronously.
      • dispose

        void dispose()
        Specified by:
        dispose in interface org.apache.flink.util.Disposable