sarthfrey commented on a change in pull request #27395: [SPARK-30667][CORE] Add 
allGather method to BarrierTaskContext
URL: https://github.com/apache/spark/pull/27395#discussion_r378007443
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/BarrierCoordinator.scala
 ##########
 @@ -199,14 +242,20 @@ private[spark] class BarrierCoordinator(
   }
 
   override def receiveAndReply(context: RpcCallContext): PartialFunction[Any, 
Unit] = {
-    case request @ RequestToSync(numTasks, stageId, stageAttemptId, _, _) =>
+    case request @ BarrierRequestToSync(numTasks, stageId, stageAttemptId, _, 
_, _, _) =>
       // Get or init the ContextBarrierState correspond to the stage attempt.
       val barrierId = ContextBarrierId(stageId, stageAttemptId)
       states.computeIfAbsent(barrierId,
         (key: ContextBarrierId) => new ContextBarrierState(key, numTasks))
       val barrierState = states.get(barrierId)
-
-      barrierState.handleRequest(context, request)
+      barrierState.handleRequest(context, request, "")
+    case request @ AllGatherRequestToSync(numTasks, stageId, stageAttemptId, 
_, _, _, _, msg) =>
+      // Get or init the ContextBarrierState correspond to the stage attempt.
+      val barrierId = ContextBarrierId(stageId, stageAttemptId)
+      states.computeIfAbsent(barrierId,
+        (key: ContextBarrierId) => new ContextBarrierState(key, numTasks))
+      val barrierState = states.get(barrierId)
+      barrierState.handleRequest(context, request, msg)
 
 Review comment:
   ~~I'm new to Scala, do you have any idea how to get around the fact that 
`case request @ A | B` is illegal in Scala? (IE alternative matching doesnt 
support variables)~~
   
   Edit: resolved!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to