This is an automated email from the ASF dual-hosted git repository.
ethanfeng pushed a commit to branch branch-0.5
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/branch-0.5 by this push:
new 83765597c [CELEBORN-1541] Enhance the readable address for internal
port
83765597c is described below
commit 83765597ca78a531f80233d4490e5a998d97e8a3
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]>
(cherry picked from commit dceef479bb217eb5f5b7dfa5728c3c05c4ac7e86)
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 a0eedc3f9..a53486f38 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
@@ -155,7 +155,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 = {