Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/spark-env.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# - SPARK_EXECUTOR_CORES, Number of cores for the executors (Default: 1).
# - SPARK_EXECUTOR_MEMORY, Memory per Executor (e.g. 1000M, 2G) (Default: 1G)
# - SPARK_DRIVER_MEMORY, Memory for Driver (e.g. 1000M, 2G) (Default: 1G)
# - SPARK_EXECUTOR_LAUNCH_PREFIX, Command string added in front of Spark executor

# Options for the daemons used in the standalone deploy mode
# - SPARK_MASTER_HOST, to bind the master to a different IP address or hostname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ private[yarn] class ExecutorRunnable(
*/

// For log4j configuration to reference
javaOpts += ("-Dspark.yarn.app.container.log.dir=" + ApplicationConstants.LOG_DIR_EXPANSION_VAR)
javaOpts += ("-Dspark.yarn.app.container.log.dir="
+ ApplicationConstants.LOG_DIR_EXPANSION_VAR)
YarnCommandBuilderUtils.addPermGenSizeOpt(javaOpts)

val userClassPath = Client.getUserClasspath(sparkConf).flatMap { uri =>
Expand All @@ -207,8 +208,14 @@ private[yarn] class ExecutorRunnable(
}.toSeq

YarnSparkHadoopUtil.addOutOfMemoryErrorArgument(javaOpts)

// Add support for extra executor prefix.
val executorCommandPrefix = (if (sys.env.contains("SPARK_EXECUTOR_LAUNCH_PREFIX"))
sys.env.get("SPARK_EXECUTOR_LAUNCH_PREFIX") else "");

val commands = prefixEnv ++ Seq(
YarnSparkHadoopUtil.expandEnvironment(Environment.JAVA_HOME) + "/bin/java",
executorCommandPrefix + " " + YarnSparkHadoopUtil.expandEnvironment(Environment.JAVA_HOME) +
"/bin/java",
"-server") ++
javaOpts ++
Seq("org.apache.spark.executor.CoarseGrainedExecutorBackend",
Expand Down