Class DefaultOperatorStateBackend

java.lang.Object
org.apache.flink.runtime.state.DefaultOperatorStateBackend
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.flink.api.common.state.OperatorStateStore, OperatorStateBackend, Snapshotable<SnapshotResult<OperatorStateHandle>>, org.apache.flink.util.Disposable

@Internal public class DefaultOperatorStateBackend extends Object implements OperatorStateBackend
Default implementation of OperatorStateStore that provides the ability to make snapshots.
  • Field Details

    • DEFAULT_OPERATOR_STATE_NAME

      public static final String DEFAULT_OPERATOR_STATE_NAME
      The default namespace for state in cases where no state name is provided
      See Also:
  • Constructor Details

  • Method Details

    • getExecutionConfig

      public org.apache.flink.api.common.ExecutionConfig getExecutionConfig()
    • getRegisteredStateNames

      public Set<String> getRegisteredStateNames()
      Specified by:
      getRegisteredStateNames in interface org.apache.flink.api.common.state.OperatorStateStore
    • getRegisteredBroadcastStateNames

      public Set<String> getRegisteredBroadcastStateNames()
      Specified by:
      getRegisteredBroadcastStateNames in interface org.apache.flink.api.common.state.OperatorStateStore
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.apache.flink.util.Disposable
      Specified by:
      dispose in interface OperatorStateBackend
    • getBroadcastState

      public <K, V> org.apache.flink.api.common.state.BroadcastState<K,V> getBroadcastState(org.apache.flink.api.common.state.MapStateDescriptor<K,V> stateDescriptor) throws org.apache.flink.util.StateMigrationException
      Specified by:
      getBroadcastState in interface org.apache.flink.api.common.state.OperatorStateStore
      Throws:
      org.apache.flink.util.StateMigrationException
    • getListState

      public <S> org.apache.flink.api.common.state.ListState<S> getListState(org.apache.flink.api.common.state.ListStateDescriptor<S> stateDescriptor) throws Exception
      Specified by:
      getListState in interface org.apache.flink.api.common.state.OperatorStateStore
      Throws:
      Exception
    • getUnionListState

      public <S> org.apache.flink.api.common.state.ListState<S> getUnionListState(org.apache.flink.api.common.state.ListStateDescriptor<S> stateDescriptor) throws Exception
      Specified by:
      getUnionListState in interface org.apache.flink.api.common.state.OperatorStateStore
      Throws:
      Exception
    • getBroadcastState

      public <K, V> org.apache.flink.api.common.state.BroadcastState<K,V> getBroadcastState(org.apache.flink.api.common.state.v2.MapStateDescriptor<K,V> stateDescriptor) throws Exception
      Specified by:
      getBroadcastState in interface org.apache.flink.api.common.state.OperatorStateStore
      Throws:
      Exception
    • getListState

      public <S> org.apache.flink.api.common.state.v2.ListState<S> getListState(org.apache.flink.api.common.state.v2.ListStateDescriptor<S> stateDescriptor) throws Exception
      Specified by:
      getListState in interface org.apache.flink.api.common.state.OperatorStateStore
      Throws:
      Exception
    • getUnionListState

      public <S> org.apache.flink.api.common.state.v2.ListState<S> getUnionListState(org.apache.flink.api.common.state.v2.ListStateDescriptor<S> stateDescriptor) throws Exception
      Specified by:
      getUnionListState in interface org.apache.flink.api.common.state.OperatorStateStore
      Throws:
      Exception
    • snapshot

      @Nonnull public RunnableFuture<SnapshotResult<OperatorStateHandle>> 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<SnapshotResult<OperatorStateHandle>>
      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