Repository: spark
Updated Branches:
  refs/heads/master 9da7ceed8 -> c76865c62


[SPARK-11484][WEBUI] Using proxyBase set by spark AM

Use the proxyBase set by the AM, if not found then use env. This is to fix the 
issue if somebody accidentally set APPLICATION_WEB_PROXY_BASE to wrong proxyBase

Author: Srinivasa Reddy Vundela <v...@cloudera.com>

Closes #9448 from vundela/master.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c76865c6
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c76865c6
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c76865c6

Branch: refs/heads/master
Commit: c76865c6220e3e7b2a266bbc4935567ef55303d8
Parents: 9da7cee
Author: Srinivasa Reddy Vundela <v...@cloudera.com>
Authored: Thu Nov 5 11:30:44 2015 -0800
Committer: Marcelo Vanzin <van...@cloudera.com>
Committed: Thu Nov 5 11:30:44 2015 -0800

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/ui/UIUtils.scala | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/c76865c6/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/ui/UIUtils.scala 
b/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
index 68a9f91..25dcb60 100644
--- a/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
+++ b/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
@@ -143,14 +143,10 @@ private[spark] object UIUtils extends Logging {
 
   // Yarn has to go through a proxy so the base uri is provided and has to be 
on all links
   def uiRoot: String = {
-    if (System.getenv("APPLICATION_WEB_PROXY_BASE") != null) {
-      System.getenv("APPLICATION_WEB_PROXY_BASE")
-    } else if (System.getProperty("spark.ui.proxyBase") != null) {
-      System.getProperty("spark.ui.proxyBase")
-    }
-    else {
-      ""
-    }
+    // SPARK-11484 - Use the proxyBase set by the AM, if not found then use 
env.
+    sys.props.get("spark.ui.proxyBase")
+      .orElse(sys.env.get("APPLICATION_WEB_PROXY_BASE"))
+      .getOrElse("")
   }
 
   def prependBaseUri(basePath: String = "", resource: String = ""): String = {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to