Class AsyncKeyedStateBackendAdaptor<K>

    • Method Detail

      • createState

        @Nonnull
        public <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
        Description copied from interface: AsyncKeyedStateBackend
        Creates and returns a new state.
        Specified by:
        createState in interface AsyncKeyedStateBackend<K>
        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
        public StateExecutor createStateExecutor()
        Description copied from interface: AsyncKeyedStateBackend
        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.

        Specified by:
        createStateExecutor in interface AsyncKeyedStateBackend<K>
        Returns:
        a StateExecutor which supports to execute a batch of state requests asynchronously.
      • dispose

        public void dispose()
        Specified by:
        dispose in interface AsyncKeyedStateBackend<K>
        Specified by:
        dispose in interface org.apache.flink.util.Disposable
      • notifyCheckpointComplete

        public void notifyCheckpointComplete​(long checkpointId)
                                      throws Exception
        Specified by:
        notifyCheckpointComplete in interface org.apache.flink.api.common.state.CheckpointListener
        Throws:
        Exception
      • notifyCheckpointAborted

        public void notifyCheckpointAborted​(long checkpointId)
                                     throws Exception
        Specified by:
        notifyCheckpointAborted in interface org.apache.flink.api.common.state.CheckpointListener
        Throws:
        Exception
      • notifyCheckpointSubsumed

        public void notifyCheckpointSubsumed​(long checkpointId)
                                      throws Exception
        Specified by:
        notifyCheckpointSubsumed in interface org.apache.flink.api.common.state.InternalCheckpointListener
        Throws:
        Exception
      • snapshot

        @Nonnull
        public RunnableFuture<SnapshotResult<KeyedStateHandle>> snapshot​(long checkpointId,
                                                                         long timestamp,
                                                                         @Nonnull
                                                                         CheckpointStreamFactory streamFactory,
                                                                         @Nonnull
                                                                         CheckpointOptions checkpointOptions)
                                                                  throws Exception
        Description copied from interface: Snapshotable
        Operation that writes a snapshot into a stream that is provided by the given CheckpointStreamFactory and returns a @RunnableFuture that gives a state handle to the snapshot. It is up to the implementation if the operation is performed synchronous or asynchronous. In the later case, the returned Runnable must be executed first before obtaining the handle.
        Specified by:
        snapshot in interface Snapshotable<K>
        Parameters:
        checkpointId - The ID of the checkpoint.
        timestamp - The timestamp of the checkpoint.
        streamFactory - The factory that we can use for writing our state to streams.
        checkpointOptions - Options for how to perform this checkpoint.
        Returns:
        A runnable future that will yield a StateObject.
        Throws:
        Exception