Skip to content

Commit 6007f86

Browse files
HDDS-14249. Add ozone.scm.names fallback for SCM client addresses (apache#9591)
1 parent acbb439 commit 6007f86

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMNodeInfo.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,18 @@ public static List<SCMNodeInfo> buildNodeInfo(ConfigurationSource conf) {
127127
// Following current approach of fall back to
128128
// OZONE_SCM_CLIENT_ADDRESS_KEY to figure out hostname.
129129

130-
String scmBlockClientAddress = getHostNameFromConfigKeys(conf,
131-
OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY,
132-
OZONE_SCM_CLIENT_ADDRESS_KEY).orElse(null);
133-
134130
String scmClientAddress = getHostNameFromConfigKeys(conf,
135-
OZONE_SCM_CLIENT_ADDRESS_KEY).orElse(null);
131+
OZONE_SCM_CLIENT_ADDRESS_KEY,
132+
OZONE_SCM_NAMES).orElse(null);
133+
134+
String scmBlockClientAddress = getHostNameFromConfigKeys(conf,
135+
OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY).orElse(scmClientAddress);
136136

137-
String scmSecurityClientAddress =
138-
getHostNameFromConfigKeys(conf,
139-
OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY,
140-
OZONE_SCM_CLIENT_ADDRESS_KEY).orElse(null);
137+
String scmSecurityClientAddress = getHostNameFromConfigKeys(conf,
138+
OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY).orElse(scmClientAddress);
141139

142-
String scmDatanodeAddress =
143-
getHostNameFromConfigKeys(conf,
144-
OZONE_SCM_DATANODE_ADDRESS_KEY,
145-
OZONE_SCM_CLIENT_ADDRESS_KEY, OZONE_SCM_NAMES).orElse(null);
140+
String scmDatanodeAddress = getHostNameFromConfigKeys(conf,
141+
OZONE_SCM_DATANODE_ADDRESS_KEY).orElse(scmClientAddress);
146142

147143
int scmBlockClientPort = getPortNumberFromConfigKeys(conf,
148144
OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY)

0 commit comments

Comments
 (0)