Github user Ishiihara commented on a diff in the pull request:
https://github.com/apache/spark/pull/2533#discussion_r18026933
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
---
@@ -179,25 +178,22 @@ class CoarseGrainedSchedulerBackend(scheduler:
TaskSchedulerImpl, actorSystem: A
}
}
else {
- freeCores(task.executorId) -= scheduler.CPUS_PER_TASK
- executorActor(task.executorId) ! LaunchTask(new
SerializableBuffer(serializedTask))
+ val executorInfo = executorData(task.executorId)
+ executorInfo.freeCores -= scheduler.CPUS_PER_TASK
+ executorInfo.executorActor ! LaunchTask(new
SerializableBuffer(serializedTask))
}
}
}
// Remove a disconnected slave from the cluster
def removeExecutor(executorId: String, reason: String) {
- if (executorActor.contains(executorId)) {
- logInfo("Executor " + executorId + " disconnected, so removing it")
- val numCores = totalCores(executorId)
- executorActor -= executorId
- executorHost -= executorId
- addressToExecutorId -= executorAddress(executorId)
- executorAddress -= executorId
- totalCores -= executorId
- freeCores -= executorId
- totalCoreCount.addAndGet(-numCores)
- scheduler.executorLost(executorId, SlaveLost(reason))
+ executorData.get(executorId) match {
--- End diff --
How about using getOrElse instead? It should be more concise.
---
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]