diff options
author | Denny <dennybritz@gmail.com> | 2012-08-02 15:59:39 -0700 |
---|---|---|
committer | Denny <dennybritz@gmail.com> | 2012-08-02 15:59:39 -0700 |
commit | 53008c2d8a8b28f4204eaafa89f0e8087dc11466 (patch) | |
tree | 1f1ee1568a80a0e42043cc0b130753dd791fa670 /core/src/main | |
parent | aaed039e36b6b29b59e650ef075f66a6e4162449 (diff) | |
download | spark-53008c2d8a8b28f4204eaafa89f0e8087dc11466.tar.gz spark-53008c2d8a8b28f4204eaafa89f0e8087dc11466.tar.bz2 spark-53008c2d8a8b28f4204eaafa89f0e8087dc11466.zip |
Settings variables and bugfix for stop script.
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/scala/spark/deploy/master/MasterArguments.scala | 13 | ||||
-rw-r--r-- | core/src/main/scala/spark/deploy/worker/WorkerArguments.scala | 16 |
2 files changed, 27 insertions, 2 deletions
diff --git a/core/src/main/scala/spark/deploy/master/MasterArguments.scala b/core/src/main/scala/spark/deploy/master/MasterArguments.scala index 5d975cd546..0f7a92bdd0 100644 --- a/core/src/main/scala/spark/deploy/master/MasterArguments.scala +++ b/core/src/main/scala/spark/deploy/master/MasterArguments.scala @@ -10,7 +10,18 @@ class MasterArguments(args: Array[String]) { var ip = Utils.localIpAddress() var port = 7077 var webUiPort = 8080 - + + // Check for settings in environment variables + if (System.getenv("SPARK_MASTER_IP") != null) { + ip = System.getenv("SPARK_MASTER_IP") + } + if (System.getenv("SPARK_MASTER_PORT") != null) { + port = System.getenv("SPARK_MASTER_PORT").toInt + } + if (System.getenv("SPARK_MASTER_WEBUI_PORT") != null) { + webUiPort = System.getenv("SPARK_MASTER_WEBUI_PORT").toInt + } + parse(args.toList) def parse(args: List[String]): Unit = args match { diff --git a/core/src/main/scala/spark/deploy/worker/WorkerArguments.scala b/core/src/main/scala/spark/deploy/worker/WorkerArguments.scala index 3248d03697..1efe8304ea 100644 --- a/core/src/main/scala/spark/deploy/worker/WorkerArguments.scala +++ b/core/src/main/scala/spark/deploy/worker/WorkerArguments.scala @@ -15,7 +15,21 @@ class WorkerArguments(args: Array[String]) { var cores = inferDefaultCores() var memory = inferDefaultMemory() var master: String = null - + + // Check for settings in environment variables + if (System.getenv("SPARK_WORKER_PORT") != null) { + port = System.getenv("SPARK_WORKER_PORT").toInt + } + if (System.getenv("SPARK_WORKER_CORES") != null) { + cores = System.getenv("SPARK_WORKER_CORES").toInt + } + if (System.getenv("SPARK_WORKER_MEMORY") != null) { + memory = Utils.memoryStringToMb(System.getenv("SPARK_WORKER_MEMORY")) + } + if (System.getenv("SPARK_WORKER_WEBUI_PORT") != null) { + webUiPort = System.getenv("SPARK_WORKER_WEBUI_PORT").toInt + } + parse(args.toList) def parse(args: List[String]): Unit = args match { |