You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by li...@apache.org on 2015/05/11 08:08:25 UTC
spark git commit: [SPARK-7519] [SQL] fix minor bugs in thrift server
UI
Repository: spark
Updated Branches:
refs/heads/master 0835f1edd -> 2242ab31e
[SPARK-7519] [SQL] fix minor bugs in thrift server UI
Bugs description:
1. There are extra commas on the top of session list.
2. The format of time in "Start at:" part is not the same as others.
3. The total number of online sessions is wrong.
Author: tianyi <ti...@gmail.com>
Closes #6048 from tianyi/SPARK-7519 and squashes the following commits:
ed366b7 [tianyi] fix bug
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/2242ab31
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/2242ab31
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/2242ab31
Branch: refs/heads/master
Commit: 2242ab31e99227a102b0918d73db67e99899fd24
Parents: 0835f1e
Author: tianyi <ti...@gmail.com>
Authored: Mon May 11 14:08:15 2015 +0800
Committer: Cheng Lian <li...@databricks.com>
Committed: Mon May 11 14:08:15 2015 +0800
----------------------------------------------------------------------
.../spark/sql/hive/thriftserver/HiveThriftServer2.scala | 4 +++-
.../spark/sql/hive/thriftserver/ui/ThriftServerPage.scala | 10 +++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/2242ab31/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
----------------------------------------------------------------------
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
index 0be5a92..3458b04 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
@@ -147,7 +147,7 @@ object HiveThriftServer2 extends Logging {
override def onApplicationEnd(applicationEnd: SparkListenerApplicationEnd): Unit = {
server.stop()
}
-
+ var onlineSessionNum: Int = 0
val sessionList = new mutable.LinkedHashMap[String, SessionInfo]
val executionList = new mutable.LinkedHashMap[String, ExecutionInfo]
val retainedStatements =
@@ -170,11 +170,13 @@ object HiveThriftServer2 extends Logging {
def onSessionCreated(ip: String, sessionId: String, userName: String = "UNKNOWN"): Unit = {
val info = new SessionInfo(sessionId, System.currentTimeMillis, ip, userName)
sessionList.put(sessionId, info)
+ onlineSessionNum += 1
trimSessionIfNecessary()
}
def onSessionClosed(sessionId: String): Unit = {
sessionList(sessionId).finishTimestamp = System.currentTimeMillis
+ onlineSessionNum -= 1
}
def onStatementStart(
http://git-wip-us.apache.org/repos/asf/spark/blob/2242ab31/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
----------------------------------------------------------------------
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
index 71b16b6..6a2be4a 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala
@@ -29,7 +29,7 @@ import org.apache.spark.ui.UIUtils._
import org.apache.spark.ui._
-/** Page for Spark Web UI that shows statistics of a streaming job */
+/** Page for Spark Web UI that shows statistics of a thrift server */
private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage("") with Logging {
private val listener = parent.listener
@@ -42,7 +42,7 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage(""
generateBasicStats() ++
<br/> ++
<h4>
- {listener.sessionList.size} session(s) are online,
+ {listener.onlineSessionNum} session(s) are online,
running {listener.totalRunning} SQL statement(s)
</h4> ++
generateSessionStatsTable() ++
@@ -50,12 +50,12 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage(""
UIUtils.headerSparkPage("ThriftServer", content, parent, Some(5000))
}
- /** Generate basic stats of the streaming program */
+ /** Generate basic stats of the thrift server program */
private def generateBasicStats(): Seq[Node] = {
val timeSinceStart = System.currentTimeMillis() - startTime.getTime
<ul class ="unstyled">
<li>
- <strong>Started at: </strong> {startTime.toString}
+ <strong>Started at: </strong> {formatDate(startTime)}
</li>
<li>
<strong>Time since start: </strong>{formatDurationVerbose(timeSinceStart)}
@@ -148,7 +148,7 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage(""
<tr>
<td> {session.userName} </td>
<td> {session.ip} </td>
- <td> <a href={sessionLink}> {session.sessionId} </a> </td>,
+ <td> <a href={sessionLink}> {session.sessionId} </a> </td>
<td> {formatDate(session.startTimestamp)} </td>
<td> {if(session.finishTimestamp > 0) formatDate(session.finishTimestamp)} </td>
<td> {formatDurationOption(Some(session.totalTime))} </td>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org