tgravescs commented on a change in pull request #26682: [SPARK-29306][CORE] 
Stage Level Sched: Executors need to track what ResourceProfile they are 
created with 
URL: https://github.com/apache/spark/pull/26682#discussion_r362024841
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitor.scala
 ##########
 @@ -392,8 +415,29 @@ private[spark] class ExecutorMonitor(
    * which the `SparkListenerTaskStart` event is posted before the 
`SparkListenerBlockManagerAdded`
    * event, which is possible because these events are posted in different 
threads. (see SPARK-4951)
    */
-  private def ensureExecutorIsTracked(id: String): Tracker = {
-    executors.computeIfAbsent(id, _ => new Tracker())
+  private def ensureExecutorIsTracked(id: String, resourceProfileId: Int): 
Tracker = {
+    val numExecsWithRpId = 
execResourceProfileCount.getOrElseUpdate(resourceProfileId, 0)
+    val execTracker = executors.computeIfAbsent(id, _ => {
+        val newcount = numExecsWithRpId + 1
+        execResourceProfileCount(resourceProfileId) = newcount
+        logDebug(s"Executor added with ResourceProfile id: $resourceProfileId 
" +
+          s"count is now $newcount")
+        val tracker = new Tracker()
+        tracker.resourceProfileId = resourceProfileId
 
 Review comment:
   good idea, will update

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to