This is an automated email from the ASF dual-hosted git repository. xianjingfeng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push: new 50cde3c20 [#1909] [FOLLOWUP] improve(common): Avoid load missing key from system properties (#1951) 50cde3c20 is described below commit 50cde3c20772d767473bc1b95316aadb000b8a21 Author: maobaolong <baoloong...@tencent.com> AuthorDate: Mon Jul 29 09:55:13 2024 +0800 [#1909] [FOLLOWUP] improve(common): Avoid load missing key from system properties (#1951) ### What changes were proposed in this pull request? Avoid load missing key from system properties ### Why are the changes needed? Fix: Followup work of #1909 Without this PR, all jvm args will be displayed in dashboard, it can be noisy and useless. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Tested locally. added jvm args -Dmissing.key=xxx -Drss.coordinator.app.expired=50000 -Drss.rpc.metrics.enabled=false then, check the result. --- .../java/org/apache/uniffle/common/config/RssBaseConf.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/org/apache/uniffle/common/config/RssBaseConf.java b/common/src/main/java/org/apache/uniffle/common/config/RssBaseConf.java index 0ada7bfb6..d41adae29 100644 --- a/common/src/main/java/org/apache/uniffle/common/config/RssBaseConf.java +++ b/common/src/main/java/org/apache/uniffle/common/config/RssBaseConf.java @@ -17,6 +17,7 @@ package org.apache.uniffle.common.config; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -301,16 +302,13 @@ public class RssBaseConf extends RssConf { if (properties == null) { return false; } + Map<String, String> propertiesFromSystem = new HashMap<>(); System.getProperties().stringPropertyNames().stream() .forEach( propName -> { - properties.put(propName, System.getProperty(propName)); + propertiesFromSystem.put(propName, System.getProperty(propName)); }); - return loadCommonConf(properties) && loadConf(properties, configOptions, true); - } - - public boolean loadCommonConf(Map<String, String> properties) { - List<ConfigOption<Object>> configOptions = ConfigUtils.getAllConfigOptions(RssBaseConf.class); - return loadConf(properties, configOptions, false); + return loadConf(properties, configOptions, true) + && loadConf(propertiesFromSystem, configOptions, false); } }