Class StreamOperatorStateHandler

java.lang.Object
org.apache.flink.streaming.api.operators.StreamOperatorStateHandler

@Internal public class StreamOperatorStateHandler extends Object
Class encapsulating various state backend handling logic for StreamOperator implementations.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Constructor Details

    • StreamOperatorStateHandler

      public StreamOperatorStateHandler(StreamOperatorStateContext context, org.apache.flink.api.common.ExecutionConfig executionConfig, org.apache.flink.core.fs.CloseableRegistry closeableRegistry)
  • Method Details

    • initializeOperatorState

      public void initializeOperatorState(StreamOperatorStateHandler.CheckpointedStreamOperator streamOperator) throws Exception
      Throws:
      Exception
    • dispose

      public void dispose() throws Exception
      Throws:
      Exception
    • snapshotState

      public OperatorSnapshotFutures snapshotState(StreamOperatorStateHandler.CheckpointedStreamOperator streamOperator, Optional<InternalTimeServiceManager<?>> timeServiceManager, String operatorName, long checkpointId, long timestamp, CheckpointOptions checkpointOptions, CheckpointStreamFactory factory, boolean isUsingCustomRawKeyedState, boolean useAsyncState) throws CheckpointException
      Throws:
      CheckpointException
    • prepareCanonicalSavepoint

      @Nonnull public static SnapshotStrategyRunner<KeyedStateHandle,? extends FullSnapshotResources<?>> prepareCanonicalSavepoint(CheckpointableKeyedStateBackend<?> keyedStateBackend, org.apache.flink.core.fs.CloseableRegistry closeableRegistry) throws Exception
      Throws:
      Exception
    • notifyCheckpointComplete

      public void notifyCheckpointComplete(long checkpointId) throws Exception
      Throws:
      Exception
    • notifyCheckpointAborted

      public void notifyCheckpointAborted(long checkpointId) throws Exception
      Throws:
      Exception
    • getKeySerializer

      public <K> org.apache.flink.api.common.typeutils.TypeSerializer<K> getKeySerializer()
    • getKeyedStateBackend

      public <K> KeyedStateBackend<K> getKeyedStateBackend()
    • getAsyncKeyedStateBackend

      @Nullable public <K> AsyncKeyedStateBackend<K> getAsyncKeyedStateBackend()
    • getOperatorStateBackend

      public OperatorStateBackend getOperatorStateBackend()
    • getOrCreateKeyedState

      public <N, S extends org.apache.flink.api.common.state.State, T> S getOrCreateKeyedState(org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, org.apache.flink.api.common.state.StateDescriptor<S,T> stateDescriptor) throws Exception
      Throws:
      Exception
    • getOrCreateKeyedState

      public <N, S extends org.apache.flink.api.common.state.v2.State, T> S getOrCreateKeyedState(N defaultNamespace, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, org.apache.flink.api.common.state.v2.StateDescriptor<T> stateDescriptor) throws Exception
      Create new state (v2) based on new state descriptor.
      Throws:
      Exception
    • getPartitionedState

      protected <S extends org.apache.flink.api.common.state.State, N> S getPartitionedState(N namespace, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, org.apache.flink.api.common.state.StateDescriptor<S,?> stateDescriptor) throws Exception
      Creates a partitioned state handle, using the state backend configured for this task.
      Throws:
      IllegalStateException - Thrown, if the key/value state was already initialized.
      Exception - Thrown, if the state backend cannot create the key/value state.
    • setCurrentKey

      public void setCurrentKey(Object key)
    • getCurrentKey

      public Object getCurrentKey()
    • getAsyncInternalTimerServiceManager

      public InternalTimeServiceManager<?> getAsyncInternalTimerServiceManager()
    • getKeyedStateStore

      public Optional<org.apache.flink.api.common.state.KeyedStateStore> getKeyedStateStore()