Interface ManagedInitializationContext

  • All Known Subinterfaces:
    FunctionInitializationContext, StateInitializationContext
    All Known Implementing Classes:
    StateInitializationContextImpl

    public interface ManagedInitializationContext
    This interface provides a context in which operators can initialize by registering to managed state (i.e. state that is managed by state backends).

    Operator state is available to all operators, while keyed state is only available for operators after keyBy.

    For the purpose of initialization, the context signals if the state is empty (new operator) or was restored from a previous execution of this operator.

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      org.apache.flink.api.common.state.KeyedStateStore getKeyedStateStore()
      Returns an interface that allows for registering keyed state with the backend.
      org.apache.flink.api.common.state.OperatorStateStore getOperatorStateStore()
      Returns an interface that allows for registering operator state with the backend.
      OptionalLong getRestoredCheckpointId()
      Returns id of the restored checkpoint, if state was restored from the snapshot of a previous execution.
      default boolean isRestored()
      Returns true, if state was restored from the snapshot of a previous execution.
    • Method Detail

      • isRestored

        default boolean isRestored()
        Returns true, if state was restored from the snapshot of a previous execution.
      • getRestoredCheckpointId

        OptionalLong getRestoredCheckpointId()
        Returns id of the restored checkpoint, if state was restored from the snapshot of a previous execution.
      • getOperatorStateStore

        org.apache.flink.api.common.state.OperatorStateStore getOperatorStateStore()
        Returns an interface that allows for registering operator state with the backend.
      • getKeyedStateStore

        org.apache.flink.api.common.state.KeyedStateStore getKeyedStateStore()
        Returns an interface that allows for registering keyed state with the backend.