public class StateBackendLoader extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FS_STATE_BACKEND_NAME
Deprecated.
|
static String |
HASHMAP_STATE_BACKEND_NAME
The shortcut configuration name of the HashMap state backend.
|
static String |
MEMORY_STATE_BACKEND_NAME
Deprecated.
|
static String |
ROCKSDB_STATE_BACKEND_NAME
The shortcut configuration name for the RocksDB State Backend.
|
Modifier and Type | Method and Description |
---|---|
static StateBackend |
fromApplicationOrConfigOrDefault(StateBackend fromApplication,
Configuration config,
ClassLoader classLoader,
org.slf4j.Logger logger)
This is the state backend loader that loads a
DelegatingStateBackend wrapping the
state backend loaded from loadFromApplicationOrConfigOrDefaultInternal(org.apache.flink.runtime.state.StateBackend, org.apache.flink.configuration.Configuration, java.lang.ClassLoader, org.slf4j.Logger) when delegation is enabled. |
static StateBackend |
loadStateBackendFromConfig(ReadableConfig config,
ClassLoader classLoader,
org.slf4j.Logger logger)
Loads the state backend from the configuration.
|
static boolean |
stateBackendFromApplicationOrConfigOrDefaultUseManagedMemory(Configuration config,
Optional<Boolean> stateBackendFromApplicationUsesManagedMemory,
ClassLoader classLoader)
Checks whether state backend uses managed memory, without having to deserialize or load the
state backend.
|
public static final String HASHMAP_STATE_BACKEND_NAME
@Deprecated public static final String MEMORY_STATE_BACKEND_NAME
@Deprecated public static final String FS_STATE_BACKEND_NAME
public static final String ROCKSDB_STATE_BACKEND_NAME
public static StateBackend loadStateBackendFromConfig(ReadableConfig config, ClassLoader classLoader, @Nullable org.slf4j.Logger logger) throws IllegalConfigurationException, DynamicCodeLoadingException, IOException
ChangelogStateBackend
if
'CheckpointingOptions.ENABLE_STATE_CHANGE_LOG
' is enabled; otherwise returns an
unwrapped state backend created through loadUnwrappedStateBackendFromConfig(org.apache.flink.configuration.ReadableConfig, java.lang.ClassLoader, org.slf4j.Logger)
.
Refer to loadUnwrappedStateBackendFromConfig(org.apache.flink.configuration.ReadableConfig, java.lang.ClassLoader, org.slf4j.Logger)
for details on how
an unwrapped state backend is loaded from the configuration.
config
- The configuration to load the state backend fromclassLoader
- The class loader that should be used to load the state backendlogger
- Optionally, a logger to log actions to (may be null)ChangelogStateBackend
if 'CheckpointingOptions.ENABLE_STATE_CHANGE_LOG
' is enabled; An unwrapped state backend
otherwiseDynamicCodeLoadingException
- Thrown if a state backend factory is configured and the
factory class was not found or the factory could not be instantiatedIllegalConfigurationException
- May be thrown by the StateBackendFactory when creating
/ configuring the state backend in the factoryIOException
- May be thrown by the StateBackendFactory when instantiating the state
backendpublic static StateBackend fromApplicationOrConfigOrDefault(@Nullable StateBackend fromApplication, Configuration config, ClassLoader classLoader, @Nullable org.slf4j.Logger logger) throws IllegalConfigurationException, DynamicCodeLoadingException, IOException
DelegatingStateBackend
wrapping the
state backend loaded from loadFromApplicationOrConfigOrDefaultInternal(org.apache.flink.runtime.state.StateBackend, org.apache.flink.configuration.Configuration, java.lang.ClassLoader, org.slf4j.Logger)
when delegation is enabled.
If delegation is not enabled, the underlying wrapped state backend is returned instead.fromApplication
- StateBackend defined from applicationconfig
- The configuration to load the state backend fromclassLoader
- The class loader that should be used to load the state backendlogger
- Optionally, a logger to log actions to (may be null)DynamicCodeLoadingException
- Thrown if a state backend (factory) is configured and the
(factory) class was not found or could not be instantiatedIllegalConfigurationException
- May be thrown by the StateBackendFactory when creating
/ configuring the state backend in the factoryIOException
- May be thrown by the StateBackendFactory when instantiating the state
backendpublic static boolean stateBackendFromApplicationOrConfigOrDefaultUseManagedMemory(Configuration config, Optional<Boolean> stateBackendFromApplicationUsesManagedMemory, ClassLoader classLoader)
config
- Cluster configuration.stateBackendFromApplicationUsesManagedMemory
- Whether the application-defined backend
uses Flink's managed memory. Empty if application has not defined a backend.classLoader
- User code classloader.Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.