This is an automated email from the ASF dual-hosted git repository.
ethanfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new dceef479b [CELEBORN-1541] Enhance the readable address for internal
port
dceef479b is described below
commit dceef479bb217eb5f5b7dfa5728c3c05c4ac7e86
Author: Wang, Fei <[email protected]>
AuthorDate: Fri Aug 2 15:06:19 2024 +0800
[CELEBORN-1541] Enhance the readable address for internal port
### What changes were proposed in this pull request?
If the internal port is not defined, do not show the internal port(-1) in
the readable address.
### Why are the changes needed?
If the workerInfo is applied for the RESTful request, such as curl
`/api/v1/workers/exclude`, the internal port is always `-1`.
It is not necessary to show the `-1` in the readable address.
### Does this PR introduce _any_ user-facing change?
Just reduce the unnecessary info.
### How was this patch tested?
Not needed.
Closes #2659 from turboFei/internal_port.
Authored-by: Wang, Fei <[email protected]>
Signed-off-by: mingji <[email protected]>
---
common/src/main/scala/org/apache/celeborn/common/meta/WorkerInfo.scala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/common/src/main/scala/org/apache/celeborn/common/meta/WorkerInfo.scala
b/common/src/main/scala/org/apache/celeborn/common/meta/WorkerInfo.scala
index bc801b7c8..1524ab2be 100644
--- a/common/src/main/scala/org/apache/celeborn/common/meta/WorkerInfo.scala
+++ b/common/src/main/scala/org/apache/celeborn/common/meta/WorkerInfo.scala
@@ -156,7 +156,8 @@ class WorkerInfo(
def readableAddress(): String = {
s"Host:$host:RpcPort:$rpcPort:PushPort:$pushPort:" +
- s"FetchPort:$fetchPort:ReplicatePort:$replicatePort:$internalPort"
+ s"FetchPort:$fetchPort:ReplicatePort:$replicatePort" +
+ (if (internalPort > 0) s":InternalPort:$internalPort" else "")
}
def toUniqueId(): String = {