Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/6394#discussion_r34219133
--- Diff:
core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala ---
@@ -627,6 +641,29 @@ private[spark] class ExecutorAllocationManager(
def isExecutorIdle(executorId: String): Boolean = {
!executorIdToTaskIds.contains(executorId)
}
+
+ /**
+ * Get the number of locality aware pending tasks and related locality
preferences as the
+ * hints used for executor allocation.
+ */
+ def executorPlacementHints(): (Int, Map[String, Int]) =
+ allocationManager.synchronized {
+ var localityAwarePendingTasks: Int = 0
+ val localityToCount = new mutable.HashMap[String, Int]()
+ stageIdToPreferredLocations.values.foreach { localities =>
--- End diff --
Hi @sryza , that's a good question. Reason why I didn't differentiate
pending, running and completed tasks is that what we get here is a list to
locality preferences `Seq[Seq[String]]`, where we don't have task id mapping
information (we cannot get the exact task id at that point in DAGScheduler), so
it is hard to differentiate the status with such fine-grained 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]