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_r378010218
########## File path: core/src/main/scala/org/apache/spark/BarrierCoordinator.scala ########## @@ -173,7 +204,18 @@ private[spark] class BarrierCoordinator( requesters: ArrayBuffer[RpcCallContext], numTasks: Int): Boolean = { if (requesters.size == numTasks) { - requesters.foreach(_.reply(())) + if (requestMethodToSync == RequestMethod.BARRIER) { + requesters.foreach(_.reply("")) + } + else if (requestMethodToSync == RequestMethod.ALL_GATHER) { + val jsonArray = JArray( + allGatherMessages.map( + (msg) => JString(msg) + ).toList + ) + val json: String = compact(render(jsonArray)) Review comment: Primarily because for users using the Python API, we must deserialize the result in the python on the python side in `taskcontext.py` after it reads the result from the socket file in the `load_from_socket` function. Is there a different serialization scheme you would recommend? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org