File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ private[spark] class CoarseMesosSchedulerBackend(
6363 // Maximum number of cores to acquire (TODO: we'll need more flexible controls here)
6464 val maxCores = conf.get(" spark.cores.max" , Int .MaxValue .toString).toInt
6565
66+ val totalExpectedCores = conf.getInt(" spark.cores.max" , 0 )
67+
6668 // Cores we have acquired with each Mesos task ID
6769 val coresByTaskId = new HashMap [Int , Int ]
6870 var totalCoresAcquired = 0
@@ -333,4 +335,7 @@ private[spark] class CoarseMesosSchedulerBackend(
333335 super .applicationId
334336 }
335337
338+ override def sufficientResourcesRegistered (): Boolean = {
339+ totalCoreCount.get() >= totalExpectedCores * minRegisteredRatio
340+ }
336341}
Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ private[spark] class MesosSchedulerBackend(
6969 val listenerBus = sc.listenerBus
7070
7171 @ volatile var appId : String = _
72+
73+ if (! sc.getConf.getOption(" spark.scheduler.minRegisteredResourcesRatio" ).isEmpty) {
74+ logWarning(" spark.scheduler.minRegisteredResourcesRatio is set, "
75+ + " but it will be ignored in mesos fine-grained mode." )
76+ }
7277
7378 override def start () {
7479 synchronized {
You can’t perform that action at this time.
0 commit comments