smengcl commented on code in PR #10831:
URL: https://github.com/apache/ozone/pull/10831#discussion_r3639530957


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsUtils.java:
##########


Review Comment:
   Let's fix `HostAndPort` class as well:
   
   ```diff
   diff --git 
a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/HostAndPort.java
 
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/HostAndPort.java
   index ... .. ...
   --- 
a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/HostAndPort.java
   +++ 
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/HostAndPort.java
   @@ -18,6 +18,7 @@
    package org.apache.hadoop.hdds.scm.net;
   
    import java.net.InetSocketAddress;
   +import org.apache.hadoop.hdds.HddsUtils;
    import org.apache.hadoop.net.NetUtils;
   
    public class HostAndPort {
   @@ -35,7 +36,7 @@ public class HostAndPort {
      public HostAndPort(String host, int port) {
        this.host = host;
        this.port = port;
   -    this.hostAndPortString = host + ":" + port;
   +    this.hostAndPortString = HddsUtils.getHostPortString(host, port);
        this.hash = host.hashCode() ^ Integer.hashCode(port);
        // TODO: HDDS-15533 change the address resolution logic and make 
this.address threadsafe.
        this.address = NetUtils.createSocketAddr(hostAndPortString);
   ```
   
   Otherwise `SCMNodeInfo.buildNodeInfo()` can still produce invalid 
unbracketed authority.



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