curcur commented on a change in pull request #14943:
URL: https://github.com/apache/flink/pull/14943#discussion_r592977651
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/state/StateBackendLoader.java
##########
@@ -249,6 +306,46 @@ public static StateBackend
fromApplicationOrConfigOrDefault(
return backend;
}
+ /**
+ * This is the state backend loader that loads a {@link
DelegatingStateBackend} wrapping the
+ * state backend loaded from {@link
+ * StateBackendLoader#loadFromApplicationOrConfigOrDefaultInternal} when
delegation is enabled.
+ * If delegation is not enabled, the underlying wrapped state backend is
returned instead.
+ *
+ * @param fromApplication StateBackend defined from application
+ * @param config The configuration to load the state backend from
+ * @param classLoader The class loader that should be used to load the
state backend
+ * @param logger Optionally, a logger to log actions to (may be null)
+ * @return The instantiated state backend.
+ * @throws DynamicCodeLoadingException Thrown if a state backend (factory)
is configured and the
+ * (factory) class was not found or could not be instantiated
+ * @throws IllegalConfigurationException May be thrown by the
StateBackendFactory when creating
+ * / configuring the state backend in the factory
+ * @throws IOException May be thrown by the StateBackendFactory when
instantiating the state
+ * backend
+ */
+ public static StateBackend fromApplicationOrConfigOrDefault(
+ @Nullable StateBackend fromApplication,
+ Configuration config,
+ ClassLoader classLoader,
+ @Nullable Logger logger)
+ throws IllegalConfigurationException, DynamicCodeLoadingException,
IOException {
+
+ final StateBackend backend =
+ loadFromApplicationOrConfigOrDefaultInternal(
+ fromApplication, config, classLoader, logger);
+
+ if (config.get(CheckpointingOptions.ENABLE_STATE_CHANGE_LOG)
+ && !(fromApplication instanceof DelegatingStateBackend)) {
+ return loadChangelogStateBackend(backend, classLoader);
+ } else {
+ LOG.info(
+ "Delegate State Backend is not used, and the State Backend
is {}",
Review comment:
Yep, the logic has been changed upon its first version. Good catch!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]