Created
April 8, 2014 00:04
-
-
Save berngp/10075583 to your computer and use it in GitHub Desktop.
Bad Things On Code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// somewhere inside some cool framework | |
val classpathEntries = Option(conf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH)). | |
getOrElse(getDefaultYarnApplicationClasspath()) | |
// where | |
def getDefaultYarnApplicationClasspath(): Array[String] = { | |
try { | |
val field = classOf[MRJobConfig].getField("DEFAULT_YARN_APPLICATION_CLASSPATH") | |
field.get(null).asInstanceOf[Array[String]] | |
} catch { | |
case err: NoSuchFieldError => null | |
case err: NoSuchFieldException => null | |
} | |
} | |
// O.o ... why? oh why? Just return Empty! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment