Interface AsyncKeyedStateBackend

  • All Superinterfaces:
    AutoCloseable, Closeable, org.apache.flink.util.Disposable

    @Internal
    public interface AsyncKeyedStateBackend
    extends org.apache.flink.util.Disposable, Closeable
    An async keyed state backend provides methods supporting to access keyed state asynchronously and in batch.
    • Method Detail

      • setup

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

        @Nonnull
        <SV,​S extends org.apache.flink.api.common.state.v2.State> S createState​(@Nonnull
                                                                                      StateDescriptor<SV> stateDesc)
                                                                               throws Exception
        Creates and returns a new state.
        Type Parameters:
        SV - The type of the stored state value.
        S - The type of the public API state.
        Parameters:
        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