aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala b/core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala
index d35d5be73f..52c4419639 100644
--- a/core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala
@@ -18,13 +18,15 @@
package org.apache.spark.deploy.worker
import java.lang.management.ManagementFactory
+import org.apache.spark.Logging
import org.apache.spark.util.{IntParam, MemoryParam, Utils}
/**
* Command-line parser for the master.
*/
-private[spark] class WorkerArguments(args: Array[String]) {
+private[spark] class WorkerArguments(args: Array[String]) extends Logging {
+ initLogging()
var host = Utils.localHostName()
var port = 0
var webUiPort = 8081
@@ -40,9 +42,13 @@ private[spark] class WorkerArguments(args: Array[String]) {
if (System.getenv("SPARK_WORKER_CORES") != null) {
cores = System.getenv("SPARK_WORKER_CORES").toInt
}
- if (System.getenv("SPARK_WORKER_MEMORY") != null) {
+ if (System.getenv("SPARK_WORKER_MEM") != null) {
+ memory = Utils.memoryStringToMb(System.getenv("SPARK_WORKER_MEM"))
+ } else if (System.getenv("SPARK_WORKER_MEMORY") != null) {
+ logWarning("SPARK_WORKER_MEMORY is deprecated. Please use SPARK_WORKER_MEM instead")
memory = Utils.memoryStringToMb(System.getenv("SPARK_WORKER_MEMORY"))
}
+
if (System.getenv("SPARK_WORKER_WEBUI_PORT") != null) {
webUiPort = System.getenv("SPARK_WORKER_WEBUI_PORT").toInt
}