Skip to content
Snippets Groups Projects
Commit f94fc75c authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Merge pull request #788 from shane-huang/sparkjavaopts

For standalone mode, add worker local env setting of SPARK_JAVA_OPTS as ...
parents 06303a62 34c1f8d2
No related branches found
No related tags found
No related merge requests found
......@@ -16,4 +16,9 @@
# - SPARK_WORKER_PORT / SPARK_WORKER_WEBUI_PORT
# - SPARK_WORKER_INSTANCES, to set the number of worker instances/processes
# to be spawned on every slave machine
# - SPARK_JAVA_OPTS, to set the jvm options for executor backend. Note: This is
# only for node-specific options, whereas app-specific options should be set
# in the application.
# Examples of node-speicic options : -Dspark.local.dir, GC related options.
# Examples of app-specific options : -Dspark.serializer
......@@ -111,6 +111,7 @@ private[spark] class ExecutorRunner(
val libraryOpts = getAppEnv("SPARK_LIBRARY_PATH")
.map(p => List("-Djava.library.path=" + p))
.getOrElse(Nil)
val workerLocalOpts = Option(getenv("SPARK_JAVA_OPTS")).map(Utils.splitCommandString).getOrElse(Nil)
val userOpts = getAppEnv("SPARK_JAVA_OPTS").map(Utils.splitCommandString).getOrElse(Nil)
val memoryOpts = Seq("-Xms" + memory + "M", "-Xmx" + memory + "M")
......@@ -120,7 +121,7 @@ private[spark] class ExecutorRunner(
Seq(sparkHome + "/bin/compute-classpath" + ext),
extraEnvironment=appDesc.command.environment)
Seq("-cp", classPath) ++ libraryOpts ++ userOpts ++ memoryOpts
Seq("-cp", classPath) ++ libraryOpts ++ workerLocalOpts ++ userOpts ++ memoryOpts
}
/** Spawn a thread that will redirect a given stream to a file */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment