public class StateBackendLoader extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
FS_STATE_BACKEND_NAME
已过时。
|
static String |
HASHMAP_STATE_BACKEND_NAME
The shortcut configuration name of the HashMap state backend.
|
static String |
MEMORY_STATE_BACKEND_NAME
已过时。
|
static String |
ROCKSDB_STATE_BACKEND_NAME
The shortcut configuration name for the RocksDB State Backend.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static StateBackend |
fromApplicationOrConfigOrDefault(StateBackend fromApplication,
org.apache.flink.util.TernaryBoolean isChangelogStateBackendEnableFromApplication,
org.apache.flink.configuration.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(org.apache.flink.configuration.ReadableConfig config,
ClassLoader classLoader,
org.slf4j.Logger logger)
Loads the unwrapped state backend from the configuration, from the parameter 'state.backend',
as defined in
StateBackendOptions.STATE_BACKEND. |
static boolean |
stateBackendFromApplicationOrConfigOrDefaultUseManagedMemory(org.apache.flink.configuration.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 StateBackend loadStateBackendFromConfig(org.apache.flink.configuration.ReadableConfig config, ClassLoader classLoader, @Nullable org.slf4j.Logger logger) throws org.apache.flink.configuration.IllegalConfigurationException, org.apache.flink.util.DynamicCodeLoadingException, IOException
StateBackendOptions.STATE_BACKEND.
The state backends can be specified either via their shortcut name, or via the class name
of a StateBackendFactory. If a StateBackendFactory class name is specified, the
factory is instantiated (via its zero-argument constructor) and its StateBackendFactory.createFromConfig(ReadableConfig, ClassLoader) method is called.
Recognized shortcut names are '', '' '' (Deprecated), and '' (Deprecated).
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)org.apache.flink.util.DynamicCodeLoadingException - Thrown if a state backend factory is configured and the
factory class was not found or the factory could not be instantiatedorg.apache.flink.configuration.IllegalConfigurationException - 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, org.apache.flink.util.TernaryBoolean isChangelogStateBackendEnableFromApplication, org.apache.flink.configuration.Configuration config, ClassLoader classLoader, @Nullable org.slf4j.Logger logger) throws org.apache.flink.configuration.IllegalConfigurationException, org.apache.flink.util.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 applicationisChangelogStateBackendEnableFromApplication - whether to enable the
ChangelogStateBackend 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)org.apache.flink.util.DynamicCodeLoadingException - Thrown if a state backend (factory) is configured and the
(factory) class was not found or could not be instantiatedorg.apache.flink.configuration.IllegalConfigurationException - 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(org.apache.flink.configuration.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.