Skip to content

Commit

Permalink
[CELEBORN-1541] Enhance the readable address for internal port
Browse files Browse the repository at this point in the history
### 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 apache#2659 from turboFei/internal_port.

Authored-by: Wang, Fei <[email protected]>
Signed-off-by: mingji <[email protected]>
  • Loading branch information
turboFei authored and FMX committed Aug 2, 2024
1 parent d0ef714 commit dceef47
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit dceef47

Please sign in to comment.