aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorThomas Graves <tgraves@apache.org>2014-06-12 16:28:00 -0500
committerThomas Graves <tgraves@apache.org>2014-06-12 16:28:00 -0500
commit3962abaf93217eced5856d28ad6dc02f8b653e98 (patch)
tree14755bb92dcee10de1b7f69e0aefff3d1918e58a /core
parent358e7e51cc736223d36071b44b7ff853635fc6e7 (diff)
downloadspark-3962abaf93217eced5856d28ad6dc02f8b653e98.tar.gz
spark-3962abaf93217eced5856d28ad6dc02f8b653e98.tar.bz2
spark-3962abaf93217eced5856d28ad6dc02f8b653e98.zip
[SPARK-2080] Yarn: report HS URL in client mode, correct user in cluster mode.
Yarn client mode was not setting the app's tracking URL to the History Server's URL when configured by the user. Now client mode behaves the same as cluster mode. In SparkContext.scala, the "user.name" system property had precedence over the SPARK_USER environment variable. This means that SPARK_USER was never used, since "user.name" is always set by the JVM. In Yarn cluster mode, this means the application always reported itself as being run by user "yarn" (or whatever user was running the Yarn NM). One could argue that the correct fix would be to use UGI.getCurrentUser() here, but at least for Yarn that will match what SPARK_USER is set to. Author: Marcelo Vanzin <vanzin@cloudera.com> This patch had conflicts when merged, resolved by Committer: Thomas Graves <tgraves@apache.org> Closes #1002 from vanzin/yarn-client-url and squashes the following commits: 4046e04 [Marcelo Vanzin] Set HS link in yarn-alpha also. 4c692d9 [Marcelo Vanzin] Yarn: report HS URL in client mode, correct user in cluster mode.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/SparkContext.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala
index a7a5dd85bd..815da4def0 100644
--- a/core/src/main/scala/org/apache/spark/SparkContext.scala
+++ b/core/src/main/scala/org/apache/spark/SparkContext.scala
@@ -297,7 +297,7 @@ class SparkContext(config: SparkConf) extends Logging {
// Set SPARK_USER for user who is running SparkContext.
val sparkUser = Option {
- Option(System.getProperty("user.name")).getOrElse(System.getenv("SPARK_USER"))
+ Option(System.getenv("SPARK_USER")).getOrElse(System.getProperty("user.name"))
}.getOrElse {
SparkContext.SPARK_UNKNOWN_USER
}