bowenliang123 commented on code in PR #2701:
URL: https://github.com/apache/celeborn/pull/2701#discussion_r1739767755


##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -978,6 +988,25 @@ private[celeborn] class Master(
     context.reply(UnregisterShuffleResponse(StatusCode.SUCCESS))
   }
 
+  def batchHandleUnregisterShuffles(
+      context: RpcCallContext,
+      applicationId: String,
+      shuffleIds: List[Integer],
+      requestId: String): Unit = {
+    val map = JavaUtils.newConcurrentHashMap[Integer, StatusCode]()
+    val shuffleKeys = new util.ArrayList[String]()
+    shuffleIds.foreach { shuffleId =>
+      val shuffleKey = Utils.makeShuffleKey(applicationId, shuffleId)
+      shuffleKeys.add(shuffleKey)
+    }
+    statusSystem.batchHandleUnRegisterShuffles(shuffleKeys, requestId)
+    logInfo(s"Unregister shuffle $shuffleKeys")
+    shuffleIds.foreach { shuffleId =>
+      map.put(shuffleId, StatusCode.SUCCESS)
+    }
+    context.reply(BatchUnregisterShuffleResponses(StatusCode.SUCCESS, map))

Review Comment:
   ```suggestion
       val shuffleKeys = shuffleIds.map(shuffleId => 
Utils.makeShuffleKey(applicationId, shuffleId)).asJava
       statusSystem.batchHandleUnRegisterShuffles(shuffleKeys, requestId)
       logInfo(s"Unregister shuffle $shuffleKeys")
       val map = shuffleIds.map(shuffleId => shuffleId -> 
StatusCode.SUCCESS).toMap.asJava
       context.reply(BatchUnregisterShuffleResponses(StatusCode.SUCCESS, map))
   ```
   Another minor suggestion.
   In a more concise Scala way for the implementation.



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