You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by zh...@apache.org on 2024/01/02 13:28:06 UTC
(incubator-celeborn) branch main updated: [CELEBORN-1208][WORKER] Unify parse uniqueId to WorkerInfo
This is an automated email from the ASF dual-hosted git repository.
zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new d1b30b282 [CELEBORN-1208][WORKER] Unify parse uniqueId to WorkerInfo
d1b30b282 is described below
commit d1b30b2827ae1e00d3151d794c029ac07226d601
Author: zwangsheng <bi...@apache.org>
AuthorDate: Tue Jan 2 21:27:58 2024 +0800
[CELEBORN-1208][WORKER] Unify parse uniqueId to WorkerInfo
### What changes were proposed in this pull request?
Unify parse uniqueId to WorkerInfo
### Why are the changes needed?
Keep parse uniqueId behavior consistent and avoid multiple changes
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Unit test
Closes #2202 from zwangsheng/CELEBORN-1208.
Authored-by: zwangsheng <bi...@apache.org>
Signed-off-by: zky.zhoukeyong <zk...@alibaba-inc.com>
---
.../src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala b/common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala
index 9935adabc..da50d9965 100644
--- a/common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala
+++ b/common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala
@@ -313,10 +313,8 @@ object PbSerDeUtils {
def fromPbWorkerResource(pbWorkerResource: util.Map[String, PbWorkerResource]): WorkerResource = {
val slots = new WorkerResource()
pbWorkerResource.asScala.foreach { case (uniqueId, pbWorkerResource) =>
- val Array(host, rpcPort, pushPort, fetchPort, replicatePort) = uniqueId.split(":")
val networkLocation = pbWorkerResource.getNetworkLocation
- val workerInfo =
- new WorkerInfo(host, rpcPort.toInt, pushPort.toInt, fetchPort.toInt, replicatePort.toInt)
+ val workerInfo = WorkerInfo.fromUniqueId(uniqueId)
workerInfo.networkLocation = networkLocation
val primaryPartitionLocation = new util.ArrayList[PartitionLocation](pbWorkerResource
.getPrimaryPartitionsList.asScala.map(PbSerDeUtils.fromPbPartitionLocation).asJava)