Copilot commented on code in PR #3753:
URL: https://github.com/apache/celeborn/pull/3753#discussion_r3533451247


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala:
##########
@@ -967,6 +967,22 @@ private[celeborn] class Worker(
     sb.toString()
   }
 
+  override def workerEvent(eventType: String): String = {
+    eventType.toUpperCase(Locale.ROOT) match {
+      case "DECOMMISSIONTHENIDLE" =>
+        workerStatusManager.doTransition(WorkerEventType.DecommissionThenIdle)
+      case "RECOMMISSION" =>
+        workerStatusManager.doTransition(WorkerEventType.Recommission)
+      case _ =>
+        return s"Unsupported worker event type: $eventType. Legal types are 
'DECOMMISSIONTHENIDLE' and 'RECOMMISSION'."
+    }
+    val state = workerStatusManager.getWorkerState()
+    val sb = new StringBuilder
+    sb.append("============================ Worker Event 
=============================\n")
+    sb.append(s"Worker event $eventType received (state=$state): \n")
+    sb.append(workerInfo.toString()).append("\n")
+  }

Review Comment:
   `workerEvent` is declared to return `String`, but the method currently ends 
with `sb.append(...)` and never returns the built string. This makes the method 
type-inconsistent and will not compile (or will fail type checking) because the 
last expression is a `StringBuilder`, not a `String`.



-- 
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