aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPatrick Wendell <pwendell@gmail.com>2014-01-15 13:55:14 -0800
committerPatrick Wendell <pwendell@gmail.com>2014-01-15 13:55:14 -0800
commit59f475c79fc8fd6d3485e4d0adf6768b6a9225a4 (patch)
tree3f16f18b3b9ab4d4468fb10dd0755d8866501e80 /core
parent2a05403a7ced4ecf6084c96f582ee3a24f3cc874 (diff)
parent00a3f7eec584fa52266ff0fe3e85bbe7603183a6 (diff)
downloadspark-59f475c79fc8fd6d3485e4d0adf6768b6a9225a4.tar.gz
spark-59f475c79fc8fd6d3485e4d0adf6768b6a9225a4.tar.bz2
spark-59f475c79fc8fd6d3485e4d0adf6768b6a9225a4.zip
Merge pull request #442 from pwendell/standalone
Workers should use working directory as spark home if it's not specified If users don't set SPARK_HOME in their environment file when launching an application, the standalone cluster should default to the spark home of the worker.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala b/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
index 5182dcbb2a..312560d706 100644
--- a/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
@@ -209,8 +209,11 @@ private[spark] class Worker(
logWarning("Invalid Master (" + masterUrl + ") attempted to launch executor.")
} else {
logInfo("Asked to launch executor %s/%d for %s".format(appId, execId, appDesc.name))
+ // TODO (pwendell): We shuld make sparkHome an Option[String] in
+ // ApplicationDescription to be more explicit about this.
+ val effectiveSparkHome = Option(execSparkHome_).getOrElse(sparkHome.getAbsolutePath)
val manager = new ExecutorRunner(appId, execId, appDesc, cores_, memory_,
- self, workerId, host, new File(execSparkHome_), workDir, akkaUrl, ExecutorState.RUNNING)
+ self, workerId, host, new File(effectiveSparkHome), workDir, akkaUrl, ExecutorState.RUNNING)
executors(appId + "/" + execId) = manager
manager.start()
coresUsed += cores_