FMX commented on code in PR #3285:
URL: https://github.com/apache/celeborn/pull/3285#discussion_r2113044764


##########
common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala:
##########
@@ -278,6 +278,12 @@ object PbSerDeUtils {
     if (masterPersistWorkerNetworkLocation) {
       workerInfo.networkLocation = pbWorkerInfo.getNetworkLocation
     }
+    // If the next interruption notice is not specified in the message, set to 
max.
+    if (pbWorkerInfo.getNextInterruptionNotice == 0) {
+      workerInfo.nextInterruptionNotice_$eq(Long.MaxValue)
+    } else {
+      
workerInfo.nextInterruptionNotice_$eq(pbWorkerInfo.getNextInterruptionNotice)

Review Comment:
   ```suggestion
         workerInfo.nextInterruptionNotice = 
pbWorkerInfo.getNextInterruptionNotice
   ```



##########
common/src/test/scala/org/apache/celeborn/common/util/PbSerDeUtilsTest.scala:
##########
@@ -126,6 +126,7 @@ class PbSerDeUtilsTest extends CelebornFunSuite {
       diskInfos,
       userResourceConsumption)
   workerInfo1.networkLocation = "/1"
+  workerInfo1.nextInterruptionNotice_$eq(10000)

Review Comment:
   ditto



##########
common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala:
##########
@@ -278,6 +278,12 @@ object PbSerDeUtils {
     if (masterPersistWorkerNetworkLocation) {
       workerInfo.networkLocation = pbWorkerInfo.getNetworkLocation
     }
+    // If the next interruption notice is not specified in the message, set to 
max.
+    if (pbWorkerInfo.getNextInterruptionNotice == 0) {
+      workerInfo.nextInterruptionNotice_$eq(Long.MaxValue)
+    } else {
+      
workerInfo.nextInterruptionNotice_$eq(pbWorkerInfo.getNextInterruptionNotice)

Review Comment:
   PbSerDeUtils is a Scala class, which means that you don't need to use the 
equals method.



##########
common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala:
##########
@@ -278,6 +278,12 @@ object PbSerDeUtils {
     if (masterPersistWorkerNetworkLocation) {
       workerInfo.networkLocation = pbWorkerInfo.getNetworkLocation
     }
+    // If the next interruption notice is not specified in the message, set to 
max.
+    if (pbWorkerInfo.getNextInterruptionNotice == 0) {
+      workerInfo.nextInterruptionNotice_$eq(Long.MaxValue)

Review Comment:
   ```suggestion
         workerInfo.nextInterruptionNotice = Long.MaxValue
   ```



##########
openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml:
##########
@@ -1019,6 +1044,21 @@ components:
         - fetchPort
         - replicatePort
 
+
+    WorkerInterruptionNotice:
+      type: object
+      properties:
+        host:
+          type: string
+          description: The host of the worker.

Review Comment:
   Better to use the worker's unique ID. Sometimes there are multiple workers 
on the same host.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to