akpatnam25 commented on code in PR #2564:
URL: https://github.com/apache/celeborn/pull/2564#discussion_r1640175725
##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -414,8 +414,28 @@ object Utils extends Logging {
customHostname = Some(hostname)
}
+ val ipv6AddressPattern = """^\[.*:.*\]$""".r
Review Comment:
I was thinking that in case `CELEBORN_LOCAL_IP` is set to ipv6 address with
`[]` unknowingly by the user. Do you think we still don't need it? If we don't
need it, then this code can jut become:
```
def localHostName(conf: CelebornConf): String = customHostname.getOrElse {
if (conf.bindPreferIP) {
localIpAddress match {
case ipv6Address: Inet6Address => s"[${ipv6Address.getHostAddress}]"
case other => other.getHostAddress
}
} else {
localIpAddress.getCanonicalHostName
}
}
```
We do not need the other method `addBracketsIfNeeded` or any unit tests
required. cc @mridulm @FMX
--
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]