Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/src/main/resources/org/apache/spark/ui/static/webui.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,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
Expand Down Expand Up @@ -1334,8 +1334,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"
Expand Down
1 change: 1 addition & 0 deletions core/src/main/scala/org/apache/spark/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ package org.apache

package object spark {
// For package docs only
val SPARK_VERSION = "1.1.2-SNAPSHOT"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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)
}

Expand Down
23 changes: 9 additions & 14 deletions core/src/main/scala/org/apache/spark/ui/UIUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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>
}
Expand All @@ -229,18 +227,15 @@ 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>
</div>
</div>
{content}
</div>
<div id="footer">
<div class="container-fluid">
<p class="muted credit">Spark {SparkContext.SPARK_VERSION}</p>
</div>
</div>
</body>
</html>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down Expand Up @@ -227,7 +227,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
}
}
Expand Down