You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by js...@apache.org on 2017/09/27 12:49:07 UTC
spark git commit: [SAPRK-20785][WEB-UI][SQL] Spark should provide
jump links and add (count) in the SQL web ui.
Repository: spark
Updated Branches:
refs/heads/master 74daf622d -> d2b8b63b9
[SAPRK-20785][WEB-UI][SQL] Spark should provide jump links and add (count) in the SQL web ui.
## What changes were proposed in this pull request?
propose:
it provide links that jump to Running Queries,Completed Queries and Failed Queries.
it add (count) about Running Queries,Completed Queries and Failed Queries.
This is a small optimization in in the SQL web ui.
fix before:

fix after:

## How was this patch tested?
manual tests
Please review http://spark.apache.org/contributing.html before opening a pull request.
Author: guoxiaolong <gu...@zte.com.cn>
Closes #19346 from guoxiaolongzte/SPARK-20785.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d2b8b63b
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d2b8b63b
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d2b8b63b
Branch: refs/heads/master
Commit: d2b8b63b9318710500f5a57bedc418d0c75b1450
Parents: 74daf62
Author: guoxiaolong <gu...@zte.com.cn>
Authored: Wed Sep 27 20:48:55 2017 +0800
Committer: jerryshao <ss...@hortonworks.com>
Committed: Wed Sep 27 20:48:55 2017 +0800
----------------------------------------------------------------------
.../sql/execution/ui/AllExecutionsPage.scala | 39 +++++++++++++++++---
1 file changed, 34 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/d2b8b63b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala
index 41929ed..f9c6986 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala
@@ -20,7 +20,7 @@ package org.apache.spark.sql.execution.ui
import javax.servlet.http.HttpServletRequest
import scala.collection.mutable
-import scala.xml.Node
+import scala.xml.{Node, NodeSeq}
import org.apache.commons.lang3.StringEscapeUtils
@@ -38,19 +38,19 @@ private[ui] class AllExecutionsPage(parent: SQLTab) extends WebUIPage("") with L
if (listener.getRunningExecutions.nonEmpty) {
_content ++=
new RunningExecutionTable(
- parent, "Running Queries", currentTime,
+ parent, s"Running Queries (${listener.getRunningExecutions.size})", currentTime,
listener.getRunningExecutions.sortBy(_.submissionTime).reverse).toNodeSeq
}
if (listener.getCompletedExecutions.nonEmpty) {
_content ++=
new CompletedExecutionTable(
- parent, "Completed Queries", currentTime,
+ parent, s"Completed Queries (${listener.getCompletedExecutions.size})", currentTime,
listener.getCompletedExecutions.sortBy(_.submissionTime).reverse).toNodeSeq
}
if (listener.getFailedExecutions.nonEmpty) {
_content ++=
new FailedExecutionTable(
- parent, "Failed Queries", currentTime,
+ parent, s"Failed Queries (${listener.getFailedExecutions.size})", currentTime,
listener.getFailedExecutions.sortBy(_.submissionTime).reverse).toNodeSeq
}
_content
@@ -61,7 +61,36 @@ private[ui] class AllExecutionsPage(parent: SQLTab) extends WebUIPage("") with L
details.parentNode.querySelector('.stage-details').classList.toggle('collapsed')
}}
</script>
- UIUtils.headerSparkPage("SQL", content, parent, Some(5000))
+ val summary: NodeSeq =
+ <div>
+ <ul class="unstyled">
+ {
+ if (listener.getRunningExecutions.nonEmpty) {
+ <li>
+ <a href="#running-execution-table"><strong>Running Queries:</strong></a>
+ {listener.getRunningExecutions.size}
+ </li>
+ }
+ }
+ {
+ if (listener.getCompletedExecutions.nonEmpty) {
+ <li>
+ <a href="#completed-execution-table"><strong>Completed Queries:</strong></a>
+ {listener.getCompletedExecutions.size}
+ </li>
+ }
+ }
+ {
+ if (listener.getFailedExecutions.nonEmpty) {
+ <li>
+ <a href="#failed-execution-table"><strong>Failed Queries:</strong></a>
+ {listener.getFailedExecutions.size}
+ </li>
+ }
+ }
+ </ul>
+ </div>
+ UIUtils.headerSparkPage("SQL", summary ++ content, parent, Some(5000))
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org