Package org.apache.flink.runtime.state
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
Modifier and TypeMethodDescriptionorg.apache.flink.api.common.state.KeyedStateStoreReturns an interface that allows for registering keyed state with the backend.org.apache.flink.api.common.state.OperatorStateStoreReturns an interface that allows for registering operator state with the backend.Returns id of the restored checkpoint, if state was restored from the snapshot of a previous execution.default booleanReturns true, if state was restored from the snapshot of a previous execution.
-
Method Details
-
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.
-