aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKousuke Saruta <sarutak@oss.nttdata.co.jp>2016-01-05 00:39:50 -0800
committerReynold Xin <rxin@databricks.com>2016-01-05 00:39:50 -0800
commit8eb2dc7133b4d2143adffc2bdbb61d96bd41a0ac (patch)
treefa02f326801784094df10a38366c0c5ca2b18324
parent53beddc5bf04a35ab73de99158919c2fdd5d4508 (diff)
downloadspark-8eb2dc7133b4d2143adffc2bdbb61d96bd41a0ac.tar.gz
spark-8eb2dc7133b4d2143adffc2bdbb61d96bd41a0ac.tar.bz2
spark-8eb2dc7133b4d2143adffc2bdbb61d96bd41a0ac.zip
[SPARK-12641] Remove unused code related to Hadoop 0.23
Currently we don't support Hadoop 0.23 but there is a few code related to it so let's clean it up. Author: Kousuke Saruta <sarutak@oss.nttdata.co.jp> Closes #10590 from sarutak/SPARK-12641.
-rw-r--r--core/src/main/scala/org/apache/spark/util/Utils.scala13
1 files changed, 3 insertions, 10 deletions
diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala
index 0c1f9c1ae2..9bdcc4d817 100644
--- a/core/src/main/scala/org/apache/spark/util/Utils.scala
+++ b/core/src/main/scala/org/apache/spark/util/Utils.scala
@@ -662,9 +662,7 @@ private[spark] object Utils extends Logging {
private[spark] def isRunningInYarnContainer(conf: SparkConf): Boolean = {
// These environment variables are set by YARN.
- // For Hadoop 0.23.X, we check for YARN_LOCAL_DIRS (we use this below in getYarnLocalDirs())
- // For Hadoop 2.X, we check for CONTAINER_ID.
- conf.getenv("CONTAINER_ID") != null || conf.getenv("YARN_LOCAL_DIRS") != null
+ conf.getenv("CONTAINER_ID") != null
}
/**
@@ -740,17 +738,12 @@ private[spark] object Utils extends Logging {
logError(s"Failed to create local root dir in $root. Ignoring this directory.")
None
}
- }.toArray
+ }
}
/** Get the Yarn approved local directories. */
private def getYarnLocalDirs(conf: SparkConf): String = {
- // 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
- val localDirs = Option(conf.getenv("YARN_LOCAL_DIRS"))
- .getOrElse(Option(conf.getenv("LOCAL_DIRS"))
- .getOrElse(""))
+ val localDirs = Option(conf.getenv("LOCAL_DIRS")).getOrElse("")
if (localDirs.isEmpty) {
throw new Exception("Yarn Local dirs can't be empty")