This is an automated email from the ASF dual-hosted git repository.

nicholasjiang 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 2b9bc57b3 [CELEBORN-1563] Log networkLocation in WorkerInfo
2b9bc57b3 is described below

commit 2b9bc57b32a053f196f09960a32ee3ef9fe60032
Author: Aravind Patnam <[email protected]>
AuthorDate: Fri Aug 16 16:26:45 2024 +0800

    [CELEBORN-1563] Log networkLocation in WorkerInfo
    
    ### What changes were proposed in this pull request?
    Log networkLocation so that it appears during worker registration
    
    ### Why are the changes needed?
    in the case of custom network location, it would be good to log it
    
    ### Does this PR introduce _any_ user-facing change?
    
    ### How was this patch tested?
    updated unit tests
    
    Closes #2685 from akpatnam25/CELEBORN-1563.
    
    Authored-by: Aravind Patnam <[email protected]>
    Signed-off-by: SteNicholas <[email protected]>
    (cherry picked from commit 2ad44baeefd4bcd5d8220d491e1a1a2828043005)
    Signed-off-by: SteNicholas <[email protected]>
---
 .../src/main/scala/org/apache/celeborn/common/meta/WorkerInfo.scala  | 1 +
 .../test/scala/org/apache/celeborn/common/meta/WorkerInfoSuite.scala | 5 +++++
 2 files changed, 6 insertions(+)

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 a53486f38..8be95a718 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
@@ -278,6 +278,7 @@ class WorkerInfo(
        |UserResourceConsumption: $userResourceConsumptionString
        |WorkerRef: $endpoint
        |WorkerStatus: $workerStatus
+       |NetworkLocation: $networkLocation
        |""".stripMargin
   }
 
diff --git 
a/common/src/test/scala/org/apache/celeborn/common/meta/WorkerInfoSuite.scala 
b/common/src/test/scala/org/apache/celeborn/common/meta/WorkerInfoSuite.scala
index 401177e63..c1a67f5c2 100644
--- 
a/common/src/test/scala/org/apache/celeborn/common/meta/WorkerInfoSuite.scala
+++ 
b/common/src/test/scala/org/apache/celeborn/common/meta/WorkerInfoSuite.scala
@@ -234,6 +234,7 @@ class WorkerInfoSuite extends CelebornFunSuite {
     val worker1 = new WorkerInfo("h1", 10001, 10002, 10003, 1000, 10004)
     val worker2 =
       new WorkerInfo("h2", 20001, 20002, 20003, 2000, 20004, null, null)
+    worker2.networkLocation_$eq("/1")
 
     val worker3 = new WorkerInfo(
       "h3",
@@ -307,6 +308,7 @@ class WorkerInfoSuite extends CelebornFunSuite {
            |Disks: empty
            |UserResourceConsumption: empty
            |WorkerRef: null
+           |NetworkLocation: /default-rack
            |""".stripMargin
 
       val exp2 =
@@ -322,6 +324,7 @@ class WorkerInfoSuite extends CelebornFunSuite {
           |Disks: empty
           |UserResourceConsumption: empty
           |WorkerRef: null
+          |NetworkLocation: /1
           |""".stripMargin
       val exp3 =
         s"""
@@ -336,6 +339,7 @@ class WorkerInfoSuite extends CelebornFunSuite {
            |Disks: empty
            |UserResourceConsumption: empty
            |WorkerRef: null
+           |NetworkLocation: /default-rack
            |""".stripMargin
       val exp4 =
         s"""
@@ -354,6 +358,7 @@ class WorkerInfoSuite extends CelebornFunSuite {
            |UserResourceConsumption: $placeholder
            |  UserIdentifier: `tenant1`.`name1`, ResourceConsumption: 
ResourceConsumption(diskBytesWritten: 20.0 MiB, diskFileCount: 1, 
hdfsBytesWritten: 50.0 MiB, hdfsFileCount: 1, subResourceConsumptions: 
(application_1697697127390_2171854 -> ResourceConsumption(diskBytesWritten: 
20.0 MiB, diskFileCount: 1, hdfsBytesWritten: 50.0 MiB, hdfsFileCount: 1, 
subResourceConsumptions: empty)))
            |WorkerRef: null
+           |NetworkLocation: /default-rack
            |""".stripMargin
 
       assertEquals(

Reply via email to