apache/spark — pull request #2086 by chesterxgchen (2014-08-21 21:34:10+00:00)
Title: Spark 3177 Yarn-alpha ClientBaseSuite Unit test failed

Yarn-alpha ClientBaseSuite Unit test failed due to differences of MRJobConfig API between yarn-stable and yarn-alpha.
The class field
MRJobConfig.DEFAULT_MAPREDUCE_APPLICATION_CLASSPATH
in yarn-alpha
returns String Array

in yarn
returns String

the method will works for yarn-stable but will fail as it try to cast String Array to String.

val knownDefMRAppCP: Seq[String] =
getFieldValue[String, Seq[String]](classOf[MRJobConfig],
"DEFAULT_MAPREDUCE_APPLICATION_CLASSPATH",
Seq[String]())(a => a.split(","))

The fix is change the code :

val knownDefMRAppCP: Seq[String] = ClientBase.getDefaultMRApplicationClasspath.getOrElse(Seq[String]())