RexXiong commented on code in PR #2713:
URL: https://github.com/apache/celeborn/pull/2713#discussion_r1742208997
##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -415,8 +415,33 @@ object Utils extends Logging {
customHostname = Some(hostname)
}
- def localHostName(conf: CelebornConf): String = customHostname.getOrElse {
- if (conf.bindPreferIP) {
+ def localHostName(conf: CelebornConf): String = {
+ getHostName(conf.bindPreferIP)
+ }
+
+ def localHostNameForAdvertiseAddress(conf: CelebornConf, env: String):
String = {
+ if (env.equals(RpcNameConstants.MASTER_SYS) || env.equals(
+ RpcNameConstants.MASTER_INTERNAL_SYS)) {
+ getAdvertiseAddressForMaster(conf)
+ } else {
+ getAdvertiseAddressForWorker(conf)
+ }
+ }
+
+ private def getAdvertiseAddressForMaster(conf: CelebornConf) = {
+ if (conf.masterHost != "<localhost>") {
+ conf.masterHost
Review Comment:
Perhaps you mean that if celeborn.master.host is set, we should prioritize
using that. If that’s the case, we can define a new method for this.
```
def advertiseMasterHost: String =
get(MASTER_HOST).replace(<localhost>",
Utils.getHostName(this.advertisePreferIP))
```
--
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]