diff options
author | Y.CORP.YAHOO.COM\tgraves <tgraves@thatenemy-lm.champ.corp.yahoo.com> | 2013-08-27 14:34:27 -0500 |
---|---|---|
committer | Y.CORP.YAHOO.COM\tgraves <tgraves@thatenemy-lm.champ.corp.yahoo.com> | 2013-08-27 14:34:27 -0500 |
commit | 3f206bf0b56888c718983b7832677a894e36eee3 (patch) | |
tree | 264d7365a827998da79494288564118beba5ab9a /yarn/src | |
parent | cf52a3cba6cce34d5d4da3da285c9d49d4ed3ceb (diff) | |
download | spark-3f206bf0b56888c718983b7832677a894e36eee3.tar.gz spark-3f206bf0b56888c718983b7832677a894e36eee3.tar.bz2 spark-3f206bf0b56888c718983b7832677a894e36eee3.zip |
Updated based on review comments.
Diffstat (limited to 'yarn/src')
-rw-r--r-- | yarn/src/main/scala/spark/deploy/yarn/ApplicationMaster.scala | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/yarn/src/main/scala/spark/deploy/yarn/ApplicationMaster.scala b/yarn/src/main/scala/spark/deploy/yarn/ApplicationMaster.scala index 33e6293a6b..0f3b6bc1a6 100644 --- a/yarn/src/main/scala/spark/deploy/yarn/ApplicationMaster.scala +++ b/yarn/src/main/scala/spark/deploy/yarn/ApplicationMaster.scala @@ -98,15 +98,12 @@ class ApplicationMaster(args: ApplicationMasterArguments, conf: Configuration) e // Hadoop 0.23 and 2.x have different Environment variable names for the // local dirs, so lets check both. We assume one of the 2 is set. // LOCAL_DIRS => 2.X, YARN_LOCAL_DIRS => 0.23.X - var localDirs = System.getenv("LOCAL_DIRS") - val yarnLocalSysDirs = Option(System.getenv("YARN_LOCAL_DIRS")) - yarnLocalSysDirs match { - case Some(s) => localDirs = s - case None => { - if ((localDirs == null) || (localDirs.isEmpty())) { - throw new Exception("Yarn Local dirs can't be empty") - } - } + val localDirs = Option(System.getenv("YARN_LOCAL_DIRS")) + .getOrElse(Option(System.getenv("LOCAL_DIRS")) + .getOrElse("")) + + if (localDirs.isEmpty()) { + throw new Exception("Yarn Local dirs can't be empty") } return localDirs } |