Skip to content

Commit

Permalink
[CELEBORN-1563] Log networkLocation in WorkerInfo
Browse files Browse the repository at this point in the history
### 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 apache#2685 from akpatnam25/CELEBORN-1563.

Authored-by: Aravind Patnam <apatnam@linkedin.com>
Signed-off-by: SteNicholas <programgeek@163.com>
  • Loading branch information
Aravind Patnam authored and SteNicholas committed Aug 16, 2024
1 parent 879f8cd commit 2ad44ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class WorkerInfo(
|UserResourceConsumption: $userResourceConsumptionString
|WorkerRef: $endpoint
|WorkerStatus: $workerStatus
|NetworkLocation: $networkLocation
|""".stripMargin
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -307,6 +308,7 @@ class WorkerInfoSuite extends CelebornFunSuite {
|Disks: empty
|UserResourceConsumption: empty
|WorkerRef: null
|NetworkLocation: /default-rack
|""".stripMargin

val exp2 =
Expand All @@ -322,6 +324,7 @@ class WorkerInfoSuite extends CelebornFunSuite {
|Disks: empty
|UserResourceConsumption: empty
|WorkerRef: null
|NetworkLocation: /1
|""".stripMargin
val exp3 =
s"""
Expand All @@ -336,6 +339,7 @@ class WorkerInfoSuite extends CelebornFunSuite {
|Disks: empty
|UserResourceConsumption: empty
|WorkerRef: null
|NetworkLocation: /default-rack
|""".stripMargin
val exp4 =
s"""
Expand All @@ -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(
Expand Down

0 comments on commit 2ad44ba

Please sign in to comment.