diff options
author | jerryshao <sshao@hortonworks.com> | 2015-08-18 18:53:19 -0700 |
---|---|---|
committer | Marcelo Vanzin <vanzin@cloudera.com> | 2015-08-18 18:53:19 -0700 |
commit | 1f8902964d8af7853c389b3b013b3a9b002c6c06 (patch) | |
tree | a92b2d2f327a3b548f773ec741409ac5975bfa86 /yarn/src | |
parent | 04e0fea79b9acfa3a3cb81dbacb08f9d287b42c3 (diff) | |
download | spark-1f8902964d8af7853c389b3b013b3a9b002c6c06.tar.gz spark-1f8902964d8af7853c389b3b013b3a9b002c6c06.tar.bz2 spark-1f8902964d8af7853c389b3b013b3a9b002c6c06.zip |
[SPARK-9969] [YARN] Remove old MR classpath API support
Here propose to remove old MRJobConfig#DEFAULT_APPLICATION_CLASSPATH support, since we now move to Yarn stable API.
vanzin and sryza , any opinion on this? If we still want to support old API, I can close it. But as far as I know now major Hadoop releases has moved to stable API.
Author: jerryshao <sshao@hortonworks.com>
Closes #8192 from jerryshao/SPARK-9969.
Diffstat (limited to 'yarn/src')
-rw-r--r-- | yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala index 5c6a716863..8672ef6017 100644 --- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala +++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala @@ -1098,20 +1098,10 @@ object Client extends Logging { triedDefault.toOption } - /** - * In Hadoop 0.23, the MR application classpath comes with the YARN application - * classpath. In Hadoop 2.0, it's an array of Strings, and in 2.2+ it's a String. - * So we need to use reflection to retrieve it. - */ private[yarn] def getDefaultMRApplicationClasspath: Option[Seq[String]] = { val triedDefault = Try[Seq[String]] { val field = classOf[MRJobConfig].getField("DEFAULT_MAPREDUCE_APPLICATION_CLASSPATH") - val value = if (field.getType == classOf[String]) { - StringUtils.getStrings(field.get(null).asInstanceOf[String]).toArray - } else { - field.get(null).asInstanceOf[Array[String]] - } - value.toSeq + StringUtils.getStrings(field.get(null).asInstanceOf[String]).toSeq } recoverWith { case e: NoSuchFieldException => Success(Seq.empty[String]) } |