diff options
-rw-r--r-- | core/src/main/scala/spark/MesosScheduler.scala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/src/main/scala/spark/MesosScheduler.scala b/core/src/main/scala/spark/MesosScheduler.scala index 391e5f1714..dc58299a1d 100644 --- a/core/src/main/scala/spark/MesosScheduler.scala +++ b/core/src/main/scala/spark/MesosScheduler.scala @@ -99,11 +99,6 @@ private class MesosScheduler( } override def start() { - if (sc.jars.size > 0) { - // If the user added any JARS to the SparkContext, create an HTTP server - // to serve them to our executors - createJarServer() - } new Thread("Spark scheduler") { setDaemon(true) override def run { @@ -125,7 +120,11 @@ private class MesosScheduler( case Some(path) => path case None => throw new SparkException("Spark home is not set; set it through the spark.home system " + - "property, the SPARK_HOME environment variable or the SparkContext constructor") + "property, the SPARK_HOME environment variable or the SparkContext constructor") + } + // If the user added JARs to the SparkContext, create an HTTP server to ship them to executors + if (sc.jars.size > 0) { + createJarServer() } val execScript = new File(sparkHome, "spark-executor").getCanonicalPath val environment = Environment.newBuilder() |