Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/900#discussion_r14225947
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
---
@@ -244,6 +255,17 @@ class CoarseGrainedSchedulerBackend(scheduler:
TaskSchedulerImpl, actorSystem: A
throw new SparkException("Error notifying standalone scheduler's
driver actor", e)
}
}
+
+ override def isReady(): Boolean = {
+ if (ready) {
--- End diff --
It would be simpler to just inline the following code. There is no valid
performance argument for separating it.
```
(executorActor.size >= totalExecutors.get() * minRegisteredRatio)
```
Referencing the size of a HashMap in scala is a constant time operation. See
https://github.com/scala/scala/blob/v2.10.4/src/library/scala/collection/mutable/HashTable.scala#L48
`totalExecutors.get()` is also a constant time operation.
I don't see any performance argument for the current approach.
---
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.
---