@PublicEvolving public class HashMapStateBackend extends AbstractStateBackend implements ConfigurableStateBackend
CheckpointStorage.
Working state is kept on the TaskManager heap. If a TaskManager executes multiple tasks concurrently (if the TaskManager has multiple slots, or if slot-sharing is used) then the aggregate state of all tasks needs to fit into that TaskManager's memory.
As for all state backends, this backend can either be configured within the application (by creating the backend with the respective constructor parameters and setting it on the execution environment) or by specifying it in the Flink configuration.
If the state backend was specified in the application, it may pick up additional configuration
parameters from the Flink configuration. For example, if the backend if configured in the
application without a default savepoint directory, it will pick up a default savepoint directory
specified in the Flink configuration of the running job/cluster. That behavior is implemented via
the configure(ReadableConfig, ClassLoader) method.
StateBackend.CustomInitializationMetrics, StateBackend.KeyedStateBackendParameters<K>, StateBackend.OperatorStateBackendParameterslatencyTrackingConfigBuilder| 构造器和说明 |
|---|
HashMapStateBackend()
Creates a new state backend.
|
| 限定符和类型 | 方法和说明 |
|---|---|
HashMapStateBackend |
configure(org.apache.flink.configuration.ReadableConfig config,
ClassLoader classLoader)
Creates a variant of the state backend that applies additional configuration parameters.
|
<K> AbstractKeyedStateBackend<K> |
createKeyedStateBackend(StateBackend.KeyedStateBackendParameters<K> parameters)
Creates a new
CheckpointableKeyedStateBackend that is responsible for holding
keyed state and checkpointing it. |
OperatorStateBackend |
createOperatorStateBackend(StateBackend.OperatorStateBackendParameters parameters)
Creates a new
OperatorStateBackend that can be used for storing operator state. |
boolean |
supportsNoClaimRestoreMode()
Tells if a state backend supports the
RestoreMode.NO_CLAIM mode. |
boolean |
supportsSavepointFormat(org.apache.flink.core.execution.SavepointFormatType formatType) |
getCompressionDecoratorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateAsyncKeyedStateBackend, getName, supportsAsyncKeyedStateBackend, useManagedMemorypublic HashMapStateBackend configure(org.apache.flink.configuration.ReadableConfig config, ClassLoader classLoader) throws org.apache.flink.configuration.IllegalConfigurationException
ConfigurableStateBackendSettings that were directly done on the original state backend object in the application program typically have precedence over setting picked up from the configuration.
If no configuration is applied, or if the method directly applies configuration values to the (mutable) state backend object, this method may return the original state backend object. Otherwise it typically returns a modified copy.
configure 在接口中 ConfigurableStateBackendconfig - The configuration to pick the values from.classLoader - The class loader that should be used to load the state backend.org.apache.flink.configuration.IllegalConfigurationException - Thrown if the configuration contained invalid entries.public boolean supportsNoClaimRestoreMode()
StateBackendRestoreMode.NO_CLAIM mode.
If a state backend supports NO_CLAIM mode, it should create an independent
snapshot when it receives CheckpointType.FULL_CHECKPOINT in Snapshotable.snapshot(long, long, CheckpointStreamFactory, CheckpointOptions).
supportsNoClaimRestoreMode 在接口中 StateBackendRestoreMode.NO_CLAIM mode.public boolean supportsSavepointFormat(org.apache.flink.core.execution.SavepointFormatType formatType)
supportsSavepointFormat 在接口中 StateBackendpublic <K> AbstractKeyedStateBackend<K> createKeyedStateBackend(StateBackend.KeyedStateBackendParameters<K> parameters) throws IOException
StateBackendCheckpointableKeyedStateBackend that is responsible for holding
keyed state and checkpointing it.
Keyed State is state where each value is bound to a key.
createKeyedStateBackend 在接口中 StateBackendcreateKeyedStateBackend 在类中 AbstractStateBackendK - The type of the keys by which the state is organized.parameters - The arguments bundle for creating CheckpointableKeyedStateBackend.IOExceptionpublic OperatorStateBackend createOperatorStateBackend(StateBackend.OperatorStateBackendParameters parameters) throws BackendBuildingException
StateBackendOperatorStateBackend that can be used for storing operator state.
Operator state is state that is associated with parallel operator (or function) instances, rather than with keys.
createOperatorStateBackend 在接口中 StateBackendcreateOperatorStateBackend 在类中 AbstractStateBackendparameters - The arguments bundle for creating OperatorStateBackend.BackendBuildingExceptionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.