You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jo...@apache.org on 2015/01/21 01:40:55 UTC
spark git commit: [SPARK-5294][WebUI] Hide tables in AllStagePages
for "Active Stages, Completed Stages and Failed Stages" when they are empty
Repository: spark
Updated Branches:
refs/heads/master 2f82c841f -> 9a151ce58
[SPARK-5294][WebUI] Hide tables in AllStagePages for "Active Stages, Completed Stages and Failed Stages" when they are empty
Related to SPARK-5228 and #4028, `AllStagesPage` also should hide the table for `ActiveStages`, `CompleteStages` and `FailedStages` when they are empty.
Author: Kousuke Saruta <sa...@oss.nttdata.co.jp>
Closes #4083 from sarutak/SPARK-5294 and squashes the following commits:
a7625c1 [Kousuke Saruta] Fixed conflicts
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9a151ce5
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9a151ce5
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9a151ce5
Branch: refs/heads/master
Commit: 9a151ce58b3e756f205c9f3ebbbf3ab0ba5b33fd
Parents: 2f82c84
Author: Kousuke Saruta <sa...@oss.nttdata.co.jp>
Authored: Tue Jan 20 16:40:46 2015 -0800
Committer: Josh Rosen <jo...@databricks.com>
Committed: Tue Jan 20 16:40:46 2015 -0800
----------------------------------------------------------------------
.../apache/spark/ui/jobs/AllStagesPage.scala | 106 ++++++++++++-------
1 file changed, 69 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/9a151ce5/core/src/main/scala/org/apache/spark/ui/jobs/AllStagesPage.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/AllStagesPage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/AllStagesPage.scala
index 1da7a98..479f967 100644
--- a/core/src/main/scala/org/apache/spark/ui/jobs/AllStagesPage.scala
+++ b/core/src/main/scala/org/apache/spark/ui/jobs/AllStagesPage.scala
@@ -59,54 +59,86 @@ private[ui] class AllStagesPage(parent: StagesTab) extends WebUIPage("") {
val pools = sc.map(_.getAllPools).getOrElse(Seq.empty[Schedulable])
val poolTable = new PoolTable(pools, parent)
+ val shouldShowActiveStages = activeStages.nonEmpty
+ val shouldShowPendingStages = pendingStages.nonEmpty
+ val shouldShowCompletedStages = completedStages.nonEmpty
+ val shouldShowFailedStages = failedStages.nonEmpty
+
val summary: NodeSeq =
<div>
<ul class="unstyled">
- {if (sc.isDefined) {
- // Total duration is not meaningful unless the UI is live
- <li>
- <strong>Total Duration: </strong>
- {UIUtils.formatDuration(now - sc.get.startTime)}
- </li>
- }}
+ {
+ if (sc.isDefined) {
+ // Total duration is not meaningful unless the UI is live
+ <li>
+ <strong>Total Duration: </strong>
+ {UIUtils.formatDuration(now - sc.get.startTime)}
+ </li>
+ }
+ }
<li>
<strong>Scheduling Mode: </strong>
{listener.schedulingMode.map(_.toString).getOrElse("Unknown")}
</li>
- <li>
- <a href="#active"><strong>Active Stages:</strong></a>
- {activeStages.size}
- </li>
- <li>
- <a href="#pending"><strong>Pending Stages:</strong></a>
- {pendingStages.size}
- </li>
- <li>
- <a href="#completed"><strong>Completed Stages:</strong></a>
- {numCompletedStages}
- </li>
- <li>
- <a href="#failed"><strong>Failed Stages:</strong></a>
- {numFailedStages}
- </li>
+ {
+ if (shouldShowActiveStages) {
+ <li>
+ <a href="#active"><strong>Active Stages:</strong></a>
+ {activeStages.size}
+ </li>
+ }
+ }
+ {
+ if (shouldShowPendingStages) {
+ <li>
+ <a href="#pending"><strong>Pending Stages:</strong></a>
+ {pendingStages.size}
+ </li>
+ }
+ }
+ {
+ if (shouldShowCompletedStages) {
+ <li>
+ <a href="#completed"><strong>Completed Stages:</strong></a>
+ {numCompletedStages}
+ </li>
+ }
+ }
+ {
+ if (shouldShowFailedStages) {
+ <li>
+ <a href="#failed"><strong>Failed Stages:</strong></a>
+ {numFailedStages}
+ </li>
+ }
+ }
</ul>
</div>
- val content = summary ++
- {if (sc.isDefined && isFairScheduler) {
- <h4>{pools.size} Fair Scheduler Pools</h4> ++ poolTable.toNodeSeq
- } else {
- Seq[Node]()
- }} ++
- <h4 id="active">Active Stages ({activeStages.size})</h4> ++
- activeStagesTable.toNodeSeq ++
- <h4 id="pending">Pending Stages ({pendingStages.size})</h4> ++
- pendingStagesTable.toNodeSeq ++
- <h4 id="completed">Completed Stages ({numCompletedStages})</h4> ++
- completedStagesTable.toNodeSeq ++
- <h4 id ="failed">Failed Stages ({numFailedStages})</h4> ++
+ var content = summary ++
+ {
+ if (sc.isDefined && isFairScheduler) {
+ <h4>{pools.size} Fair Scheduler Pools</h4> ++ poolTable.toNodeSeq
+ } else {
+ Seq[Node]()
+ }
+ }
+ if (shouldShowActiveStages) {
+ content ++= <h4 id="active">Active Stages ({activeStages.size})</h4> ++
+ activeStagesTable.toNodeSeq
+ }
+ if (shouldShowPendingStages) {
+ content ++= <h4 id="pending">Pending Stages ({pendingStages.size}</h4> ++
+ pendingStagesTable.toNodeSeq
+ }
+ if (shouldShowCompletedStages) {
+ content ++= <h4 id="completed">Completed Stages ({numCompletedStages})</h4> ++
+ completedStagesTable.toNodeSeq
+ }
+ if (shouldShowFailedStages) {
+ content ++= <h4 id ="failed">Failed Stages ({numFailedStages})</h4> ++
failedStagesTable.toNodeSeq
-
+ }
UIUtils.headerSparkPage("Spark Stages (for all jobs)", content, parent)
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org