healchow commented on code in PR #6692:
URL: https://github.com/apache/inlong/pull/6692#discussion_r1036633101


##########
inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/Entrance.java:
##########
@@ -58,6 +58,12 @@ public static void main(String[] args) throws Exception {
         Parser parser;
         if (StringUtils.isEmpty(sqlFile)) {
             final GroupInfo groupInfo = 
getGroupInfoFromFile(config.getString(Constants.GROUP_INFO_FILE));
+            boolean hasAuditProxyHosts =
+                    
StringUtils.isNotEmpty(groupInfo.getProperties().get(Constants.METRICS_AUDIT_PROXY_HOSTS.key()));
+            if (!hasAuditProxyHosts) {
+                
groupInfo.getProperties().put(Constants.METRICS_AUDIT_PROXY_HOSTS.key(),
+                        config.getString(Constants.METRICS_AUDIT_PROXY_HOSTS));
+            }

Review Comment:
   Is the `putIfAbsent` method better?
   ```suggestion
               
groupInfo.getProperties().putIfAbsent(Constants.METRICS_AUDIT_PROXY_HOSTS.key(),
                       config.getString(Constants.METRICS_AUDIT_PROXY_HOSTS));
   ```



-- 
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]

Reply via email to