Github user berngp commented on a diff in the pull request:

    https://github.com/apache/spark/pull/433#discussion_r11785535
  
    --- Diff: 
yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala ---
    @@ -361,55 +361,48 @@ object ClientBase {
       val LOG4J_CONF_ENV_KEY: String = "SPARK_LOG4J_CONF"
       val LOCAL_SCHEME = "local"
     
    -  // Based on code from org.apache.hadoop.mapreduce.v2.util.MRApps
    -  def populateHadoopClasspath(conf: Configuration, env: HashMap[String, 
String]) {
    -    val classpathEntries = Option(conf.getStrings(
    -      YarnConfiguration.YARN_APPLICATION_CLASSPATH)).getOrElse(
    -        getDefaultYarnApplicationClasspath())
    -    for (c <- classpathEntries) {
    -      YarnSparkHadoopUtil.addToEnvironment(env, 
Environment.CLASSPATH.name, c.trim,
    +  def populateHadoopClasspath(conf: Configuration, env: HashMap[String, 
String]) = {
    +    val classPathElementsToAdd = getYarnAppClasspath(conf) ++ 
getMRAppClasspath(conf)
    +    for (c <- classPathElementsToAdd.flatten) {
    +      YarnSparkHadoopUtil.addToEnvironment(
    +        env,
    +        Environment.CLASSPATH.name,
    +        c.trim,
             File.pathSeparator)
         }
    +    classPathElementsToAdd
    --- End diff --
    
    Since `populateHadoopClasspath` has a _side effect_ on `env` by convention 
I am used to return the actual _side effect_ that was applied. It aids 
testing/asserting the expectation of such _side effect_ for consumers of the 
API and since `populateHadoopClasspath` is part of the public API of the 
_ClientBase:Object_ I think is a good idea to provide it.


---
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.
---

Reply via email to