@Internal public class StreamOperatorStateHandler extends Object
StreamOperator
implementations.| Modifier and Type | Class and Description |
|---|---|
static interface |
StreamOperatorStateHandler.CheckpointedStreamOperator
Custom state handling hooks to be invoked by
StreamOperatorStateHandler. |
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
StreamOperatorStateHandler(StreamOperatorStateContext context,
org.apache.flink.api.common.ExecutionConfig executionConfig,
org.apache.flink.core.fs.CloseableRegistry closeableRegistry) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
Object |
getCurrentKey() |
<K> org.apache.flink.runtime.state.KeyedStateBackend<K> |
getKeyedStateBackend() |
Optional<org.apache.flink.api.common.state.KeyedStateStore> |
getKeyedStateStore() |
org.apache.flink.runtime.state.OperatorStateBackend |
getOperatorStateBackend() |
<N,S extends org.apache.flink.api.common.state.State,T> |
getOrCreateKeyedState(org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.StateDescriptor<S,T> stateDescriptor) |
protected <S extends org.apache.flink.api.common.state.State,N> |
getPartitionedState(N namespace,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
org.apache.flink.api.common.state.StateDescriptor<S,?> stateDescriptor)
Creates a partitioned state handle, using the state backend configured for this task.
|
void |
initializeOperatorState(StreamOperatorStateHandler.CheckpointedStreamOperator streamOperator) |
void |
notifyCheckpointAborted(long checkpointId) |
void |
notifyCheckpointComplete(long checkpointId) |
static org.apache.flink.runtime.state.SnapshotStrategyRunner<org.apache.flink.runtime.state.KeyedStateHandle,? extends org.apache.flink.runtime.state.FullSnapshotResources<?>> |
prepareSavepoint(org.apache.flink.runtime.state.CheckpointableKeyedStateBackend<?> keyedStateBackend,
org.apache.flink.core.fs.CloseableRegistry closeableRegistry) |
void |
setCurrentKey(Object key) |
OperatorSnapshotFutures |
snapshotState(StreamOperatorStateHandler.CheckpointedStreamOperator streamOperator,
Optional<InternalTimeServiceManager<?>> timeServiceManager,
String operatorName,
long checkpointId,
long timestamp,
org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions,
org.apache.flink.runtime.state.CheckpointStreamFactory factory,
boolean isUsingCustomRawKeyedState) |
public StreamOperatorStateHandler(StreamOperatorStateContext context, org.apache.flink.api.common.ExecutionConfig executionConfig, org.apache.flink.core.fs.CloseableRegistry closeableRegistry)
public void initializeOperatorState(StreamOperatorStateHandler.CheckpointedStreamOperator streamOperator) throws Exception
Exceptionpublic OperatorSnapshotFutures snapshotState(StreamOperatorStateHandler.CheckpointedStreamOperator streamOperator, Optional<InternalTimeServiceManager<?>> timeServiceManager, String operatorName, long checkpointId, long timestamp, org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions, org.apache.flink.runtime.state.CheckpointStreamFactory factory, boolean isUsingCustomRawKeyedState) throws org.apache.flink.runtime.checkpoint.CheckpointException
org.apache.flink.runtime.checkpoint.CheckpointException@Nonnull public static org.apache.flink.runtime.state.SnapshotStrategyRunner<org.apache.flink.runtime.state.KeyedStateHandle,? extends org.apache.flink.runtime.state.FullSnapshotResources<?>> prepareSavepoint(org.apache.flink.runtime.state.CheckpointableKeyedStateBackend<?> keyedStateBackend, org.apache.flink.core.fs.CloseableRegistry closeableRegistry) throws Exception
Exceptionpublic void notifyCheckpointComplete(long checkpointId)
throws Exception
Exceptionpublic void notifyCheckpointAborted(long checkpointId)
throws Exception
Exceptionpublic <K> org.apache.flink.runtime.state.KeyedStateBackend<K> getKeyedStateBackend()
public org.apache.flink.runtime.state.OperatorStateBackend getOperatorStateBackend()
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
Exceptionprotected <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
IllegalStateException - Thrown, if the key/value state was already initialized.Exception - Thrown, if the state backend cannot create the key/value state.public void setCurrentKey(Object key)
public Object getCurrentKey()
public Optional<org.apache.flink.api.common.state.KeyedStateStore> getKeyedStateStore()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.