Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/15009#discussion_r84791332
--- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala ---
@@ -56,23 +56,38 @@ import org.apache.spark.internal.config._
import org.apache.spark.launcher.{LauncherBackend, SparkAppHandle,
YarnCommandBuilderUtils}
import org.apache.spark.util.Utils
+
private[spark] class Client(
val args: ClientArguments,
val hadoopConf: Configuration,
- val sparkConf: SparkConf)
+ val sparkConf: SparkConf,
+ val sysEnvironmentInput: Map[String, String])
extends Logging {
import Client._
import YarnSparkHadoopUtil._
+ def this(clientArgs: ClientArguments, spConf: SparkConf, sysEnv:
Map[String, String]) =
+ this(clientArgs, SparkHadoopUtil.get.newConfiguration(spConf), spConf,
sysEnv)
+
+ def this(clientArgs: ClientArguments, hadoopConf: Configuration, spConf:
SparkConf) =
+ this(clientArgs, hadoopConf, spConf, Map() ++ sys.env)
+
def this(clientArgs: ClientArguments, spConf: SparkConf) =
- this(clientArgs, SparkHadoopUtil.get.newConfiguration(spConf), spConf)
+ this(clientArgs, spConf, Map() ++ sys.env)
+
+ private val sysEnvironment:
scala.collection.immutable.Map[scala.Predef.String,
+ scala.Predef.String] = collection.immutable.Map() ++ sysEnvironmentInput
private val yarnClient = YarnClient.createYarnClient
private val yarnConf = new YarnConfiguration(hadoopConf)
private val isClusterMode = sparkConf.get("spark.submit.deployMode",
"client") == "cluster"
+ private val launcherServerPort : Int =
sparkConf.get("spark.launcher.internal.port", "0").toInt
--- End diff --
I think it might be worth it to have constants for these to avoid copy &
pasting the name. See how `PYSPARK_DRIVER_PYTHON` is handled in `SparkLauncher`
and `core/src/main/scala/org/apache/spark/internal/config/package.scala` (and
the unit test in `SparkLauncherSuite.java`).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]