Ngone51 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_r378006692
##########
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 think we could merge this two cases into one cases and only distinguish
the message by:
```
val message = request match {
case a @ AllGatherRequestToSync => a.msg
case _ => ""
}
```
----------------------------------------------------------------
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]