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

    https://github.com/apache/spark/pull/102#discussion_r10505297
  
    --- Diff: 
yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala ---
    @@ -379,9 +381,48 @@ object ClientBase {
     
       // Based on code from org.apache.hadoop.mapreduce.v2.util.MRApps
       def populateHadoopClasspath(conf: Configuration, env: HashMap[String, 
String]) {
    -    for (c <- 
conf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH)) {
    +    val classpathEntries = Option(conf.getStrings(
    +      YarnConfiguration.YARN_APPLICATION_CLASSPATH)).getOrElse(
    +        getDefaultYarnApplicationClasspath())
    +    for (c <- classpathEntries) {
           Apps.addToEnvironment(env, Environment.CLASSPATH.name, c.trim)
         }
    +
    +    val mrClasspathEntries = Option(conf.getStrings(
    +      "mapreduce.application.classpath")).getOrElse(
    +        getDefaultMRApplicationClasspath())
    +    if (mrClasspathEntries != null) {
    +      for (c <- mrClasspathEntries) {
    +        Apps.addToEnvironment(env, Environment.CLASSPATH.name, c.trim)
    +      }
    +    }
    +  }
    +
    +  def getDefaultYarnApplicationClasspath(): Array[String] = {
    +    try {
    +      val field = 
classOf[MRJobConfig].getField("DEFAULT_YARN_APPLICATION_CLASSPATH")
    --- End diff --
    
    
    
    Unfortunately, the alpha/stable distinction doesn't fully capture the 
differences here because the APIs are different between the 0.23 Hadoop line 
and the 2.0 line, both of which fall under yarn-alpha. The comment above 
getMapReduceApplicationClasspath explains the differences between 0.23, 2.0, 
and 2.2.



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

Reply via email to