diff options
author | Akshat Aranya <aaranya@quantcast.com> | 2014-11-19 17:20:20 -0800 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2014-11-19 17:20:20 -0800 |
commit | 9ccc53c72c5bcffcc121291710754e1e2d659341 (patch) | |
tree | a706b207901232467b2333d80c09c8e5de7c002f /core | |
parent | 377b06820934cab6d67f3a9182528c7f417a7d98 (diff) | |
download | spark-9ccc53c72c5bcffcc121291710754e1e2d659341.tar.gz spark-9ccc53c72c5bcffcc121291710754e1e2d659341.tar.bz2 spark-9ccc53c72c5bcffcc121291710754e1e2d659341.zip |
[SPARK-4478] Keep totalRegisteredExecutors up-to-date
This rebases PR 3368.
This commit fixes totalRegisteredExecutors update [SPARK-4478], so that we can correctly keep track of number of registered executors.
Author: Akshat Aranya <aaranya@quantcast.com>
Closes #3373 from coolfrood/topic/SPARK-4478 and squashes the following commits:
8a4d1e4 [Akshat Aranya] Added comment
150ae93 [Akshat Aranya] [SPARK-4478] Keep totalRegisteredExecutors up-to-date
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala b/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala index 7a6ee56f81..047fae104b 100644 --- a/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala +++ b/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala @@ -46,6 +46,7 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val actorSyste { // Use an atomic variable to track total number of cores in the cluster for simplicity and speed var totalCoreCount = new AtomicInteger(0) + // Total number of executors that are currently registered var totalRegisteredExecutors = new AtomicInteger(0) val conf = scheduler.sc.conf private val timeout = AkkaUtils.askTimeout(conf) @@ -204,6 +205,7 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val actorSyste executorsPendingToRemove -= executorId } totalCoreCount.addAndGet(-executorInfo.totalCores) + totalRegisteredExecutors.addAndGet(-1) scheduler.executorLost(executorId, SlaveLost(reason)) case None => logError(s"Asked to remove non-existent executor $executorId") } |