szetszwo commented on code in PR #10993:
URL: https://github.com/apache/ozone/pull/10993#discussion_r3792986047
##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/SafeModeCheckSubcommand.java:
##########
@@ -193,16 +193,15 @@ private boolean matchesAddress(String address1, String
address2) {
}
try {
- String host1 = HddsUtils.getHostName(address1).orElse(address1);
- String host2 = HddsUtils.getHostName(address2).orElse(address2);
-
- boolean hostsMatch = host1.equalsIgnoreCase(host2);
- if (!hostsMatch) {
- InetAddress inet1 = InetAddress.getByName(host1);
- InetAddress inet2 = InetAddress.getByName(host2);
- hostsMatch = inet1.equals(inet2);
- }
- if (!hostsMatch) {
+ // Parse both addresses into host:port components
+ String[] parts1 = address1.split(":", 2);
+ String[] parts2 = address2.split(":", 2);
+
+ String host1 = parts1[0];
+ String host2 = parts2[0];
+
+ // Hostnames must match
+ if (!host1.equalsIgnoreCase(host2)) {
Review Comment:
@navinko , This change is unrelated. If there is a need, let's do it
separately.
The PR looks good other than that.
--
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]