adoroszlai commented on code in PR #9591:
URL: https://github.com/apache/ozone/pull/9591#discussion_r2693569429


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMNodeInfo.java:
##########
@@ -129,15 +129,18 @@ public static List<SCMNodeInfo> 
buildNodeInfo(ConfigurationSource conf) {
 
       String scmBlockClientAddress = getHostNameFromConfigKeys(conf,
           OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY,
-          OZONE_SCM_CLIENT_ADDRESS_KEY).orElse(null);
+          OZONE_SCM_CLIENT_ADDRESS_KEY,
+          OZONE_SCM_NAMES).orElse(null);
 
       String scmClientAddress = getHostNameFromConfigKeys(conf,
-          OZONE_SCM_CLIENT_ADDRESS_KEY).orElse(null);
+          OZONE_SCM_CLIENT_ADDRESS_KEY,
+          OZONE_SCM_NAMES).orElse(null);

Review Comment:
   Let's move definition of `scmClientAddress` first, then use this variable as 
fallback instead of doing repeated config lookup.
   
   Something like:
   
   ```java
   String scmBlockClientAddress = getHostNameFromConfigKeys(conf, 
OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY)
       .orElse(scmClientAddress);
   String scmSecurityClientAddress = ...
   String scmDatanodeAddress = ...
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to