Github user squito commented on a diff in the pull request: https://github.com/apache/spark/pull/17533#discussion_r111271432 --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala --- @@ -1080,6 +1122,25 @@ class DAGScheduler( } } + // Visible for testing. + private[spark] def getTaskInputSizesFromShuffledRDD(tasks: Seq[Task[_]]): Map[Task[_], Long] = { + val taskInputSizeFromShuffledRDD = HashMap[Task[_], Long]() + tasks.foreach { + case task => + val size = + parentSplitsInShuffledRDD(task.stageId, task.partitionId).map { + case parentSplits => + parentSplits.map { + case (shuffleId, splits) => + splits.map(mapOutputTracker.getMapSizesByExecutorId(shuffleId, _) + .flatMap(_._2.map(_._2)).sum).sum --- End diff -- I think you can use `mapOutputTracker.getStatistics` here. It also occurs to me that in general this could use the *total* input size for the task, but I guess spark isn't looking at that in general yet (though it probably could, from hadoop's `InputSplit.getLength()`). Just something to keep in mind.
--- 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