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

    https://github.com/apache/spark/pull/8180#discussion_r37682553
  
    --- 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 --
    
    its a little strange that you need to pass `numPartitions` in here, since 
that is a property of the map output.  Maybe instead of just taking  
`shuffleId`, it should take a `shuffleHandle`, so you can get the number of map 
output partitions w/ `shuffleHandle.dependency.partioner.numPartitions`?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to