Package org.apache.flink.runtime.state
Class AbstractStateBackend
- java.lang.Object
-
- org.apache.flink.runtime.state.AbstractStateBackend
-
- All Implemented Interfaces:
Serializable,StateBackend
- Direct Known Subclasses:
AbstractFileStateBackend,AbstractManagedMemoryStateBackend,HashMapStateBackend
@PublicEvolving public abstract class AbstractStateBackend extends Object implements StateBackend, Serializable
An abstract base implementation of theStateBackendinterface.This class has currently no contents and only kept to not break the prior class hierarchy for users.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected LatencyTrackingStateConfig.BuilderlatencyTrackingConfigBuilder
-
Constructor Summary
Constructors Constructor Description AbstractStateBackend()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <K> AbstractKeyedStateBackend<K>createKeyedStateBackend(Environment env, org.apache.flink.api.common.JobID jobID, String operatorIdentifier, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, org.apache.flink.metrics.MetricGroup metricGroup, Collection<KeyedStateHandle> stateHandles, org.apache.flink.core.fs.CloseableRegistry cancelStreamRegistry)Creates a newCheckpointableKeyedStateBackendthat is responsible for holding keyed state and checkpointing it.abstract OperatorStateBackendcreateOperatorStateBackend(Environment env, String operatorIdentifier, Collection<OperatorStateHandle> stateHandles, org.apache.flink.core.fs.CloseableRegistry cancelStreamRegistry)Creates a newOperatorStateBackendthat can be used for storing operator state.static StreamCompressionDecoratorgetCompressionDecorator(org.apache.flink.api.common.ExecutionConfig executionConfig)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.state.StateBackend
createKeyedStateBackend, getName, supportsNoClaimRestoreMode, supportsSavepointFormat, useManagedMemory
-
-
-
-
Field Detail
-
latencyTrackingConfigBuilder
protected LatencyTrackingStateConfig.Builder latencyTrackingConfigBuilder
-
-
Method Detail
-
getCompressionDecorator
public static StreamCompressionDecorator getCompressionDecorator(org.apache.flink.api.common.ExecutionConfig executionConfig)
-
createKeyedStateBackend
public abstract <K> AbstractKeyedStateBackend<K> createKeyedStateBackend(Environment env, org.apache.flink.api.common.JobID jobID, String operatorIdentifier, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, org.apache.flink.metrics.MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, org.apache.flink.core.fs.CloseableRegistry cancelStreamRegistry) throws IOException
Description copied from interface:StateBackendCreates a newCheckpointableKeyedStateBackendthat is responsible for holding keyed state and checkpointing it.Keyed State is state where each value is bound to a key.
- Specified by:
createKeyedStateBackendin interfaceStateBackend- Type Parameters:
K- The type of the keys by which the state is organized.- Parameters:
env- The environment of the task.jobID- The ID of the job that the task belongs to.operatorIdentifier- The identifier text of the operator.keySerializer- The key-serializer for the operator.numberOfKeyGroups- The number of key-groups aka max parallelism.keyGroupRange- Range of key-groups for which the to-be-created backend is responsible.kvStateRegistry- KvStateRegistry helper for this task.ttlTimeProvider- Provider for TTL logic to judge about state expiration.metricGroup- The parent metric group for all state backend metrics.stateHandles- The state handles for restore.cancelStreamRegistry- The registry to which created closeable objects will be registered during restore.- Returns:
- The Keyed State Backend for the given job, operator, and key group range.
- Throws:
IOException
-
createOperatorStateBackend
public abstract OperatorStateBackend createOperatorStateBackend(Environment env, String operatorIdentifier, @Nonnull Collection<OperatorStateHandle> stateHandles, org.apache.flink.core.fs.CloseableRegistry cancelStreamRegistry) throws Exception
Description copied from interface:StateBackendCreates a newOperatorStateBackendthat can be used for storing operator state.Operator state is state that is associated with parallel operator (or function) instances, rather than with keys.
- Specified by:
createOperatorStateBackendin interfaceStateBackend- Parameters:
env- The runtime environment of the executing task.operatorIdentifier- The identifier of the operator whose state should be stored.stateHandles- The state handles for restore.cancelStreamRegistry- The registry to register streams to close if task canceled.- Returns:
- The OperatorStateBackend for operator identified by the job and operator identifier.
- Throws:
Exception- This method may forward all exceptions that occur while instantiating the backend.
-
-