jiangxb1987 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_r373730607
##########
File path: core/src/main/scala/org/apache/spark/BarrierCoordinator.scala
##########
@@ -171,9 +194,23 @@ private[spark] class BarrierCoordinator(
// have received all the sync requests.
private def maybeFinishAllRequesters(
requesters: ArrayBuffer[RpcCallContext],
- numTasks: Int): Boolean = {
+ numTasks: Int,
+ requestMethod: Int): Boolean = {
if (requesters.size == numTasks) {
- requesters.foreach(_.reply(()))
+ if (requestMethod == RequestMethod.BARRIER) {
+ requesters.foreach(_.reply(Array[Byte]()))
+ }
+ else if (requestMethod == RequestMethod.ALL_GATHER) {
+ val msgs = requests.map(
+ (request) => request.allGatherMessage
+ )
+ val msgsArray = Array[Array[Byte]](msgs: _*)
Review comment:
Do we need to keep the same order of the messages as the taskIds?
----------------------------------------------------------------
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]