Github user mateiz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8180#discussion_r37688430
  
    --- Diff: core/src/main/scala/org/apache/spark/MapOutputTracker.scala ---
    @@ -132,13 +133,46 @@ private[spark] abstract class MapOutputTracker(conf: 
SparkConf) extends Logging
        *         describing the shuffle blocks that are stored at that block 
manager.
        */
       def getMapSizesByExecutorId(shuffleId: Int, reduceId: Int)
    -  : Seq[(BlockManagerId, Seq[(BlockId, Long)])] = {
    +      : Seq[(BlockManagerId, Seq[(BlockId, Long)])] = {
         logDebug(s"Fetching outputs for shuffle $shuffleId, reduce $reduceId")
    -    val startTime = System.currentTimeMillis
    +    val statuses = getStatuses(shuffleId)
    +    // Synchronize on the returned array because, on the driver, it gets 
mutated in place
    +    statuses.synchronized {
    +      return MapOutputTracker.convertMapStatuses(shuffleId, reduceId, 
statuses)
    +    }
    +  }
    +
    +  /**
    +   * Return statistics about all of the outputs for a given shuffle.
    +   *
    +   * @param shuffleId ID of the shuffle
    +   * @param numPartitions number of map output partitions
    +   */
    +  def getStatistics(shuffleId: Int, numPartitions: Int): 
MapOutputStatistics = {
    --- End diff --
    
    Good point. It's a bit weird that we don't remember numPartitions anywhere 
else but it would be clearer this way.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to