Github user kayousterhout commented on a diff in the pull request:
https://github.com/apache/spark/pull/15986#discussion_r89418768
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala ---
@@ -88,10 +88,12 @@ private[spark] class TaskSchedulerImpl(
// Incrementing task IDs
val nextTaskId = new AtomicLong(0)
- // Number of tasks running on each executor
- private val executorIdToTaskCount = new HashMap[String, Int]
+ // IDs of the tasks running on each executor
+ private val executorIdToRunningTaskIds = new HashMap[String,
HashSet[Long]]
- def runningTasksByExecutors(): Map[String, Int] =
executorIdToTaskCount.toMap
+ def runningTasksByExecutors(): Map[String, Int] = synchronized {
+ executorIdToRunningTaskIds.toMap.mapValues(_.size)
--- End diff --
But it doesn't matter because we're creating a new map with mapValues,
right?
Anyway this seems not especially important to this PR so fine to leave
as-is.
---
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]