Skip to content

Commit e9d602d

Browse files
committed
Rename testExecutorEnvs --> executorEnvs.
This was changed, but in fact, it's used for things other than tests. So I've changed it back. Author: Patrick Wendell <pwendell@gmail.com> Closes #747 from pwendell/executor-env and squashes the following commits: 36a60a5 [Patrick Wendell] Rename testExecutorEnvs --> executorEnvs. (cherry picked from commit 3ce526b) Signed-off-by: Patrick Wendell <pwendell@gmail.com>
1 parent b66051e commit e9d602d

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,27 +276,26 @@ class SparkContext(config: SparkConf) extends Logging {
276276
.getOrElse(512)
277277

278278
// Environment variables to pass to our executors.
279-
// NOTE: This should only be used for test related settings.
280-
private[spark] val testExecutorEnvs = HashMap[String, String]()
279+
private[spark] val executorEnvs = HashMap[String, String]()
281280

282281
// Convert java options to env vars as a work around
283282
// since we can't set env vars directly in sbt.
284283
for { (envKey, propKey) <- Seq(("SPARK_TESTING", "spark.testing"))
285284
value <- Option(System.getenv(envKey)).orElse(Option(System.getProperty(propKey)))} {
286-
testExecutorEnvs(envKey) = value
285+
executorEnvs(envKey) = value
287286
}
288287
// The Mesos scheduler backend relies on this environment variable to set executor memory.
289288
// TODO: Set this only in the Mesos scheduler.
290-
testExecutorEnvs("SPARK_EXECUTOR_MEMORY") = executorMemory + "m"
291-
testExecutorEnvs ++= conf.getExecutorEnv
289+
executorEnvs("SPARK_EXECUTOR_MEMORY") = executorMemory + "m"
290+
executorEnvs ++= conf.getExecutorEnv
292291

293292
// Set SPARK_USER for user who is running SparkContext.
294293
val sparkUser = Option {
295294
Option(System.getProperty("user.name")).getOrElse(System.getenv("SPARK_USER"))
296295
}.getOrElse {
297296
SparkContext.SPARK_UNKNOWN_USER
298297
}
299-
testExecutorEnvs("SPARK_USER") = sparkUser
298+
executorEnvs("SPARK_USER") = sparkUser
300299

301300
// Create and start the scheduler
302301
private[spark] var taskScheduler = SparkContext.createTaskScheduler(this, master)

core/src/main/scala/org/apache/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private[spark] class SparkDeploySchedulerBackend(
5454
}
5555

5656
val command = Command(
57-
"org.apache.spark.executor.CoarseGrainedExecutorBackend", args, sc.testExecutorEnvs,
57+
"org.apache.spark.executor.CoarseGrainedExecutorBackend", args, sc.executorEnvs,
5858
classPathEntries, libraryPathEntries, extraJavaOpts)
5959
val sparkHome = sc.getSparkHome()
6060
val appDesc = new ApplicationDescription(sc.appName, maxCores, sc.executorMemory, command,

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private[spark] class CoarseMesosSchedulerBackend(
122122
val extraLibraryPath = conf.getOption(libraryPathOption).map(p => s"-Djava.library.path=$p")
123123
val extraOpts = Seq(extraJavaOpts, extraLibraryPath).flatten.mkString(" ")
124124

125-
sc.testExecutorEnvs.foreach { case (key, value) =>
125+
sc.executorEnvs.foreach { case (key, value) =>
126126
environment.addVariables(Environment.Variable.newBuilder()
127127
.setName(key)
128128
.setValue(value)

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private[spark] class MesosSchedulerBackend(
9090
"Spark home is not set; set it through the spark.home system " +
9191
"property, the SPARK_HOME environment variable or the SparkContext constructor"))
9292
val environment = Environment.newBuilder()
93-
sc.testExecutorEnvs.foreach { case (key, value) =>
93+
sc.executorEnvs.foreach { case (key, value) =>
9494
environment.addVariables(Environment.Variable.newBuilder()
9595
.setName(key)
9696
.setValue(value)

0 commit comments

Comments
 (0)