Repository: spark
Updated Branches:
  refs/heads/branch-1.1 c411182c6 -> 68df7342a


[SPARK-4920][UI]: back port the PR-3763 to branch 1.1

Author: uncleGen <[email protected]>

Closes #3768 from uncleGen/branch-1.1-1223 and squashes the following commits:

ec2365f [uncleGen] error fix
67a27e5 [uncleGen] [SPARK-4920][UI]: back port the PR-3763 to branch 1.1


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

Branch: refs/heads/branch-1.1
Commit: 68df7342aabac642c54ca9066b070e4c262a4546
Parents: c411182
Author: uncleGen <[email protected]>
Authored: Sat Jan 17 17:26:13 2015 -0800
Committer: Josh Rosen <[email protected]>
Committed: Sat Jan 17 17:26:13 2015 -0800

----------------------------------------------------------------------
 .../org/apache/spark/ui/static/webui.css        | 10 +++++++++
 .../scala/org/apache/spark/SparkContext.scala   |  4 +---
 .../spark/scheduler/EventLoggingListener.scala  |  4 ++--
 .../scala/org/apache/spark/ui/UIUtils.scala     | 23 ++++++++------------
 .../scheduler/EventLoggingListenerSuite.scala   |  6 ++---
 .../thriftserver/HiveThriftServer2Suite.scala   |  4 ++--
 6 files changed, 27 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/68df7342/core/src/main/resources/org/apache/spark/ui/static/webui.css
----------------------------------------------------------------------
diff --git a/core/src/main/resources/org/apache/spark/ui/static/webui.css 
b/core/src/main/resources/org/apache/spark/ui/static/webui.css
index 152bde5..acba9ce 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/webui.css
+++ b/core/src/main/resources/org/apache/spark/ui/static/webui.css
@@ -120,6 +120,16 @@ pre {
   border: none;
 }
 
+.version {
+  line-height: 30px;
+  vertical-align: bottom;
+  font-size: 12px;
+  padding: 0;
+  margin: 0;
+  font-weight: bold;
+  color: #777;
+}
+
 .tooltip {
  font-weight: normal;
 }

http://git-wip-us.apache.org/repos/asf/spark/blob/68df7342/core/src/main/scala/org/apache/spark/SparkContext.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala 
b/core/src/main/scala/org/apache/spark/SparkContext.scala
index 61c50a8..58834e2 100644
--- a/core/src/main/scala/org/apache/spark/SparkContext.scala
+++ b/core/src/main/scala/org/apache/spark/SparkContext.scala
@@ -858,7 +858,7 @@ class SparkContext(config: SparkConf) extends Logging {
   }
 
   /** The version of Spark on which this application is running. */
-  def version = SparkContext.SPARK_VERSION
+  def version = SPARK_VERSION
 
   /**
    * Return a map from the slave to the max memory available for caching and 
the remaining
@@ -1339,8 +1339,6 @@ class SparkContext(config: SparkConf) extends Logging {
  */
 object SparkContext extends Logging {
 
-  private[spark] val SPARK_VERSION = "1.1.2-SNAPSHOT"
-
   private[spark] val SPARK_JOB_DESCRIPTION = "spark.job.description"
 
   private[spark] val SPARK_JOB_GROUP_ID = "spark.jobGroup.id"

http://git-wip-us.apache.org/repos/asf/spark/blob/68df7342/core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala
----------------------------------------------------------------------
diff --git 
a/core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala 
b/core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala
index 370fcd8..730ec7e 100644
--- a/core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala
+++ b/core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala
@@ -26,7 +26,7 @@ import org.apache.hadoop.fs.permission.FsPermission
 import org.json4s.JsonAST.JValue
 import org.json4s.jackson.JsonMethods._
 
-import org.apache.spark.{Logging, SparkConf, SparkContext}
+import org.apache.spark.{Logging, SparkConf, SPARK_VERSION}
 import org.apache.spark.deploy.SparkHadoopUtil
 import org.apache.spark.io.CompressionCodec
 import org.apache.spark.util.{FileLogger, JsonProtocol, Utils}
@@ -83,7 +83,7 @@ private[spark] class EventLoggingListener(
         sparkConf.get("spark.io.compression.codec", 
CompressionCodec.DEFAULT_COMPRESSION_CODEC)
       logger.newFile(COMPRESSION_CODEC_PREFIX + codec)
     }
-    logger.newFile(SPARK_VERSION_PREFIX + SparkContext.SPARK_VERSION)
+    logger.newFile(SPARK_VERSION_PREFIX + SPARK_VERSION)
     logger.newFile(LOG_PREFIX + logger.fileIndex)
   }
 

http://git-wip-us.apache.org/repos/asf/spark/blob/68df7342/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 8c437ce..0e285dd 100644
--- a/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
+++ b/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
@@ -23,7 +23,7 @@ import java.util.{Locale, Date}
 import scala.xml.Node
 
 import org.apache.spark.Logging
-import org.apache.spark.SparkContext
+import org.apache.spark.SPARK_VERSION
 
 /** Utility functions for generating XML pages with spark content. */
 private[spark] object UIUtils extends Logging {
@@ -186,9 +186,12 @@ private[spark] object UIUtils extends Logging {
       <body>
         <div class="navbar navbar-static-top">
           <div class="navbar-inner">
-            <a href={prependBaseUri("/")} class="brand">
-              <img src={prependBaseUri("/static/spark-logo-77x50px-hd.png")} />
-            </a>
+            <div class="brand">
+              <a href={prependBaseUri("/")} class="brand">
+                <img src={prependBaseUri("/static/spark-logo-77x50px-hd.png")} 
/>
+                <span class="version">{SPARK_VERSION}</span>
+              </a>
+            </div>
             <ul class="nav">{header}</ul>
             <p class="navbar-text pull-right">
               <strong title={appName}>{shortAppName}</strong> application UI
@@ -205,11 +208,6 @@ private[spark] object UIUtils extends Logging {
           </div>
           {content}
         </div>
-        <div id="footer">
-          <div class="container-fluid">
-            <p class="muted credit">Spark {SparkContext.SPARK_VERSION}</p>
-          </div>
-        </div>
       </body>
     </html>
   }
@@ -229,6 +227,8 @@ private[spark] object UIUtils extends Logging {
                 <a style="text-decoration: none" href={prependBaseUri("/")}>
                   <img 
src={prependBaseUri("/static/spark-logo-77x50px-hd.png")}
                        style="margin-right: 15px;" />
+                  <span class="version"
+                        style="margin-right: 15px;">{SPARK_VERSION}</span>
                 </a>
                 {title}
               </h3>
@@ -236,11 +236,6 @@ private[spark] object UIUtils extends Logging {
           </div>
           {content}
         </div>
-        <div id="footer">
-          <div class="container-fluid">
-            <p class="muted credit">Spark {SparkContext.SPARK_VERSION}</p>
-          </div>
-        </div>
       </body>
     </html>
   }

http://git-wip-us.apache.org/repos/asf/spark/blob/68df7342/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala
----------------------------------------------------------------------
diff --git 
a/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala
 
b/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala
index 10d8b29..bfd7274 100644
--- 
a/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala
+++ 
b/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala
@@ -25,7 +25,7 @@ import org.apache.hadoop.fs.{FileStatus, Path}
 import org.json4s.jackson.JsonMethods._
 import org.scalatest.{BeforeAndAfter, FunSuite}
 
-import org.apache.spark.{SparkConf, SparkContext}
+import org.apache.spark.{SparkConf, SparkContext, SPARK_VERSION}
 import org.apache.spark.io.CompressionCodec
 import org.apache.spark.util.{JsonProtocol, Utils}
 
@@ -194,7 +194,7 @@ class EventLoggingListenerSuite extends FunSuite with 
BeforeAndAfter {
 
     def assertInfoCorrect(info: EventLoggingInfo, loggerStopped: Boolean) {
       assert(info.logPaths.size > 0)
-      assert(info.sparkVersion === SparkContext.SPARK_VERSION)
+      assert(info.sparkVersion === SPARK_VERSION)
       assert(info.compressionCodec.isDefined === compressionCodec.isDefined)
       info.compressionCodec.foreach { codec =>
         assert(compressionCodec.isDefined)
@@ -378,7 +378,7 @@ class EventLoggingListenerSuite extends FunSuite with 
BeforeAndAfter {
   private def assertSparkVersionIsValid(logFiles: Array[FileStatus]) {
     val file = 
logFiles.map(_.getPath.getName).find(EventLoggingListener.isSparkVersionFile)
     assert(file.isDefined)
-    assert(EventLoggingListener.parseSparkVersion(file.get) === 
SparkContext.SPARK_VERSION)
+    assert(EventLoggingListener.parseSparkVersion(file.get) === SPARK_VERSION)
   }
 
   private def assertCompressionCodecIsValid(logFiles: Array[FileStatus], 
compressionCodec: String) {

http://git-wip-us.apache.org/repos/asf/spark/blob/68df7342/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala
 
b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala
index da772de..4737d1a 100644
--- 
a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala
+++ 
b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala
@@ -37,7 +37,7 @@ import org.apache.thrift.protocol.TBinaryProtocol
 import org.apache.thrift.transport.TSocket
 import org.scalatest.FunSuite
 
-import org.apache.spark.{SparkContext, Logging}
+import org.apache.spark.{SparkContext, Logging, SPARK_VERSION}
 import org.apache.spark.sql.catalyst.util.getTempFilePath
 
 /**
@@ -228,7 +228,7 @@ class HiveThriftServer2Suite extends FunSuite with Logging {
         client.getInfo(sessionHandle, 
GetInfoType.CLI_SERVER_NAME).getStringValue
       }
 
-      assertResult(SparkContext.SPARK_VERSION, "Spark version shouldn't be 
\"Unknown\"") {
+      assertResult(SPARK_VERSION, "Spark version shouldn't be \"Unknown\"") {
         client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_VER).getStringValue
       }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to