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 {
465
465
}
466
466
467
467
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
469
472
}
470
473
471
474
/**
@@ -484,7 +487,7 @@ private[spark] object Utils extends Logging {
484
487
conf.get(" spark.local.dir" , System .getProperty(" java.io.tmpdir" )))
485
488
}
486
489
val rootDirs = confValue.split(',' )
487
- logDebug(s " Getting/creating local root dirs at ' $rootDirs ' " )
490
+ logDebug(s " Getting/creating local root dirs at ' $confValue ' " )
488
491
489
492
rootDirs.flatMap { rootDir =>
490
493
val localDir : File = new File (rootDir)
You can’t perform that action at this time.
0 commit comments