Ngone51 edited a comment on issue #28117: [SPARK-31344][CORE] Polish 
implementation of barrier() and allGather()
URL: https://github.com/apache/spark/pull/28117#issuecomment-608968979
 
 
   This PR tried to address comment 
https://github.com/apache/spark/pull/27395#pullrequestreview-357681136 , but 
please note that we can not simply build `barrier()` on top of `allGather("")`, 
because we need a way do distinguish these two different calls to prevent 
following illegal case:
   
   ```scala
   rdd.barrier().mapPartitions { iter =>
      val context = BarrierTaskContext.get()
      val partitionId = context.partitionId
      if (partitionId == 0) {
        context.barrier()
      } else {
        context.allGather(partitionId.toString)
      }
     iter
    }
   ``` 
   
   ping @sarthfrey @jiangxb1987 @mengxr Please take a look, thanks!

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