xintongsong commented on code in PR #22547:
URL: https://github.com/apache/flink/pull/22547#discussion_r1493924976
##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskExecutorResourceUtils.java:
##########
@@ -285,4 +286,15 @@ private static <T> void setConfigOptionToDefaultIfNotSet(
config.set(option, defaultValue);
}
}
+
+ private static <T> void resetConfigOption(
+ Configuration config, ConfigOption<T> option, T value) {
+ if (config.contains(option)) {
+ LOG.info(
+ "The configuration option {} has no effect for local
execution, resetting to {}",
+ option.key(),
+ value);
+ }
+ config.set(option, value);
+ }
Review Comment:
Instead of introducing this `resetConfigOption` method, I'd suggest to
simply unset all unused options. We can rename `warnOptionHasNoEffectIfSet` to
`warnAndRemoveOptionHasNoEffectIfSet`, and call `Configuration#removeOption` in
it. WDYT?
##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskExecutorResourceUtils.java:
##########
@@ -250,7 +251,7 @@ private static void
warnOptionHasNoEffectIfSet(Configuration config, ConfigOptio
"The resource configuration option {} is set but it will
have no effect for local execution, "
+ "only the following options matter for the
resource configuration: {}",
option,
- UNUSED_CONFIG_OPTIONS);
+ CONFIG_OPTIONS);
Review Comment:
Nice catch~!
##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskExecutorResourceUtils.java:
##########
@@ -285,4 +286,15 @@ private static <T> void setConfigOptionToDefaultIfNotSet(
config.set(option, defaultValue);
}
}
+
+ private static <T> void resetConfigOption(
+ Configuration config, ConfigOption<T> option, T value) {
+ if (config.contains(option)) {
+ LOG.info(
+ "The configuration option {} has no effect for local
execution, resetting to {}",
+ option.key(),
+ value);
+ }
+ config.set(option, value);
+ }
Review Comment:
Then we can have a test to verify that all unused config options are being
ignored.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]