File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
core/src/main/scala/org/apache/spark/util Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -465,7 +465,10 @@ private[spark] object Utils extends Logging {
465465 }
466466
467467 private [spark] def isRunningInYarnContainer (conf : SparkConf ): Boolean = {
468- conf.getenv(" NM_HOST" ) != null || conf.getenv(" CONTAINER_ID" ) != null
468+ // These environment variables are set by YARN.
469+ // For Hadoop 0.23.X, we check for YARN_LOCAL_DIRS (we use this below in getYarnLocalDirs())
470+ // For Hadoop 2.X, we check for CONTAINER_ID.
471+ conf.getenv(" CONTAINER_ID" ) != null || conf.getenv(" YARN_LOCAL_DIRS" ) != null
469472 }
470473
471474 /**
@@ -484,7 +487,7 @@ private[spark] object Utils extends Logging {
484487 conf.get(" spark.local.dir" , System .getProperty(" java.io.tmpdir" )))
485488 }
486489 val rootDirs = confValue.split(',' )
487- logDebug(s " Getting/creating local root dirs at ' $rootDirs ' " )
490+ logDebug(s " Getting/creating local root dirs at ' $confValue ' " )
488491
489492 rootDirs.flatMap { rootDir =>
490493 val localDir : File = new File (rootDir)
You can’t perform that action at this time.
0 commit comments