Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/22001#discussion_r208065883
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
---
@@ -496,6 +496,12 @@ class CoarseGrainedSchedulerBackend(scheduler:
TaskSchedulerImpl, val rpcEnv: Rp
executorDataMap.keySet.toSeq
}
+ override def getNumSlots(): Int = {
+ executorDataMap.values.foldLeft(0) { (num, executor) =>
+ num + executor.totalCores / scheduler.CPUS_PER_TASK
--- End diff --
~~~scala
executorDataMap.values.map { executor =>
executor.totalCores / scheduler.CPUS_PER_TASK
}.sum
~~~
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]