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
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,15 @@ trait ClientBase extends Logging {
YarnSparkHadoopUtil.setEnvFromInputString(env, System.getenv("SPARK_YARN_USER_ENV"),
File.pathSeparator)

val sparkJavaOpts = System.getenv().get("SPARK_JAVA_OPTS")
if (sparkJavaOpts != null) {
env("SPARK_JAVA_OPTS") = sparkJavaOpts
}
val sparkYarnUserEnv = System.getenv().get("SPARK_YARN_USER_ENV")
if (sparkYarnUserEnv != null) {
env("SPARK_YARN_USER_ENV") = sparkYarnUserEnv
}

env
}

Expand Down Expand Up @@ -320,6 +329,10 @@ trait ClientBase extends Logging {
JAVA_OPTS += "-XX:CMSIncrementalDutyCycle=10"
}

if (env.isDefinedAt("SPARK_JAVA_OPTS")) {
JAVA_OPTS += env("SPARK_JAVA_OPTS")
}

// TODO: it might be nicer to pass these as an internal environment variable rather than
// as Java options, due to complications with string parsing of nested quotes.
if (args.amClass == classOf[ExecutorLauncher].getName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ trait ExecutorRunnableUtil extends Logging {
sys.props.get("spark.executor.extraJavaOptions").foreach { opts =>
JAVA_OPTS += opts
}
if (env.isDefinedAt("SPARK_JAVA_OPTS")) {
JAVA_OPTS += env("SPARK_JAVA_OPTS") + " "
}

JAVA_OPTS += " -Djava.io.tmpdir=" +
new Path(Environment.PWD.$(), YarnConfiguration.DEFAULT_CONTAINER_TEMP_DIR) + " "
Expand Down