Interface StreamOperatorStateContext


  • public interface StreamOperatorStateContext
    This interface represents a context from which a stream operator can initialize everything connected to state such as e.g. backends, raw state, and timer service manager.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      org.apache.flink.runtime.state.AsyncKeyedStateBackend asyncKeyedStateBackend()
      Returns the async keyed state backend for the stream operator.
      OptionalLong getRestoredCheckpointId()
      Returns non-empty if the states provided by this context are restored from a checkpoint/savepoint.
      InternalTimeServiceManager<?> internalTimerServiceManager()
      Returns the internal timer service manager for the stream operator.
      default boolean isRestored()
      Returns true if the states provided by this context are restored from a checkpoint/savepoint.
      org.apache.flink.runtime.state.CheckpointableKeyedStateBackend<?> keyedStateBackend()
      Returns the keyed state backend for the stream operator.
      org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend()
      Returns the operator state backend for the stream operator.
      org.apache.flink.util.CloseableIterable<org.apache.flink.runtime.state.KeyGroupStatePartitionStreamProvider> rawKeyedStateInputs()
      Returns an iterable to obtain input streams for previously stored keyed state partitions that are assigned to this operator.
      org.apache.flink.util.CloseableIterable<org.apache.flink.runtime.state.StatePartitionStreamProvider> rawOperatorStateInputs()
      Returns an iterable to obtain input streams for previously stored operator state partitions that are assigned to this stream operator.
    • Method Detail

      • isRestored

        default boolean isRestored()
        Returns true if the states provided by this context are restored from a checkpoint/savepoint.
      • getRestoredCheckpointId

        OptionalLong getRestoredCheckpointId()
        Returns non-empty if the states provided by this context are restored from a checkpoint/savepoint.
      • operatorStateBackend

        org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend()
        Returns the operator state backend for the stream operator.
      • keyedStateBackend

        org.apache.flink.runtime.state.CheckpointableKeyedStateBackend<?> keyedStateBackend()
        Returns the keyed state backend for the stream operator. This method returns null for non-keyed operators.
      • asyncKeyedStateBackend

        org.apache.flink.runtime.state.AsyncKeyedStateBackend asyncKeyedStateBackend()
        Returns the async keyed state backend for the stream operator. This method returns null for operators which don't support async keyed state backend.
      • internalTimerServiceManager

        InternalTimeServiceManager<?> internalTimerServiceManager()
        Returns the internal timer service manager for the stream operator. This method returns null for non-keyed operators.
      • rawOperatorStateInputs

        org.apache.flink.util.CloseableIterable<org.apache.flink.runtime.state.StatePartitionStreamProvider> rawOperatorStateInputs()
        Returns an iterable to obtain input streams for previously stored operator state partitions that are assigned to this stream operator.
      • rawKeyedStateInputs

        org.apache.flink.util.CloseableIterable<org.apache.flink.runtime.state.KeyGroupStatePartitionStreamProvider> rawKeyedStateInputs()
        Returns an iterable to obtain input streams for previously stored keyed state partitions that are assigned to this operator. This method returns null for non-keyed operators.