@@ -41,8 +41,8 @@ import spark.scheduler.ShuffleMapTask
4141import spark .scheduler .DAGScheduler
4242import spark .scheduler .TaskScheduler
4343import spark .scheduler .local .LocalScheduler
44+ import spark .scheduler .cluster .ClusterScheduler
4445import spark .scheduler .mesos .MesosScheduler
45- import spark .scheduler .mesos .CoarseMesosScheduler
4646import spark .storage .BlockManagerMaster
4747
4848class SparkContext (
@@ -89,11 +89,17 @@ class SparkContext(
8989 new LocalScheduler (threads.toInt, maxFailures.toInt)
9090 case _ =>
9191 MesosNativeLibrary .load()
92+ val sched = new ClusterScheduler (this )
93+ val schedContext = new MesosScheduler (sched, this , master, frameworkName)
94+ sched.initialize(schedContext)
95+ sched
96+ /*
9297 if (System.getProperty("spark.mesos.coarse", "false") == "true") {
9398 new CoarseMesosScheduler(this, master, frameworkName)
9499 } else {
95100 new MesosScheduler(this, master, frameworkName)
96101 }
102+ */
97103 }
98104 }
99105 taskScheduler.start()
@@ -272,11 +278,6 @@ class SparkContext(
272278 logInfo(" Successfully stopped SparkContext" )
273279 }
274280
275- // Wait for the scheduler to be registered with the cluster manager
276- def waitForRegister () {
277- taskScheduler.waitForRegister()
278- }
279-
280281 // Get Spark's home location from either a value set through the constructor,
281282 // or the spark.home Java property, or the SPARK_HOME environment variable
282283 // (in that order of preference). If neither of these is set, return None.
0 commit comments