Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/2516#discussion_r18003201 --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmitDriverBootstrapper.scala --- @@ -50,71 +51,63 @@ private[spark] object SparkSubmitDriverBootstrapper { val javaOpts = sys.env("JAVA_OPTS") val defaultDriverMemory = sys.env("OUR_JAVA_MEM") - // Spark submit specific environment variables - val deployMode = sys.env("SPARK_SUBMIT_DEPLOY_MODE") - val propertiesFile = sys.env("SPARK_SUBMIT_PROPERTIES_FILE") + // SPARK_SUBMIT_BOOTSTRAP_DRIVER is used for runtime validation val bootstrapDriver = sys.env("SPARK_SUBMIT_BOOTSTRAP_DRIVER") - val submitDriverMemory = sys.env.get("SPARK_SUBMIT_DRIVER_MEMORY") - val submitLibraryPath = sys.env.get("SPARK_SUBMIT_LIBRARY_PATH") - val submitClasspath = sys.env.get("SPARK_SUBMIT_CLASSPATH") - val submitJavaOpts = sys.env.get("SPARK_SUBMIT_OPTS") + + // list of environment variables that override differently named properties + val envOverides = Map( "OUR_JAVA_MEM" -> SparkDriverMemory, + "SPARK_SUBMIT_DEPLOY_MODE" -> SparkDeployMode, + "SPARK_SUBMIT_PROPERTIES_FILE" -> SparkPropertiesFile, + "SPARK_SUBMIT_DRIVER_MEMORY" -> SparkDriverMemory, + "SPARK_SUBMIT_LIBRARY_PATH" -> SparkDriverExtraLibraryPath, + "SPARK_SUBMIT_CLASSPATH" -> SparkDriverExtraClassPath, + "SPARK_SUBMIT_OPTS" -> SparkDriverExtraJavaOptions + ) + + // SPARK_SUBMIT environment variables are treated as the highest priority source + // of config information for their respective config variable (as listed in envOverrides) + val submitEnvVars = new mutable.HashMap() ++ envOverides + .map( {case(varName, propName) => (sys.env.get(varName), propName) }) + .filter( {case(varVariable, _) => varVariable.isDefined} ) + .map( {case(varVariable, propName) => (propName->varVariable.get)}) + + /* In order of lowest priority to highest, we merge config vars from --- End diff -- No need to repeat the comment already on the other method. This is just asking for things to get out of sync.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org