Skip to content
Snippets Groups Projects
Commit 3f206bf0 authored by Y.CORP.YAHOO.COM\tgraves's avatar Y.CORP.YAHOO.COM\tgraves
Browse files

Updated based on review comments.

parent cf52a3cb
No related branches found
No related tags found
No related merge requests found
......@@ -119,15 +119,12 @@ private[spark] class Executor(
// 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
}
......
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment