rjgoyln commented on code in PR #11130:
URL: https://github.com/apache/ozone/pull/11130#discussion_r3885752029
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsUtils.java:
##########
@@ -243,6 +243,19 @@ public static String getHostPortString(String host, int
port) {
return HostAndPort.fromParts(host, port).toString();
}
+ /**
+ * Render an address as a "host:port" string, wrapping the host in square
+ * brackets when it is an IPv6 literal. Hadoop's
+ * {@code NetUtils.getHostPortString(InetSocketAddress)} joins the two with a
+ * plain colon, which yields an ambiguous authority for IPv6.
+ *
+ * @param addr the address to render
+ * @return the combined address, bracketed for IPv6 literals
+ */
+ public static String getHostPortString(InetSocketAddress addr) {
+ return getHostPortString(addr.getHostName(), addr.getPort());
Review Comment:
Good point. I've removed the single-argument overload. The call sites now
explicitly pass `getHostName()` and `getPort()`, making the reverse DNS lookup
cost clearly visible where it occurs.
--
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]