Skip to content

Commit

Permalink
SPARK-2250: show stage RDDs in UI
Browse files Browse the repository at this point in the history
Author: Neville Li <neville@spotify.com>

Closes #1188 from nevillelyh/neville/ui and squashes the following commits:

d3ac425 [Neville Li] SPARK-2250: show persisted RDD in stage UI
f075db9 [Neville Li] SPARK-2035: show call stack even when description is available
  • Loading branch information
nevillelyh authored and pwendell committed Jul 24, 2014
1 parent 323a83c commit fec641b
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.spark.ui.jobs

import scala.xml.Node
import scala.xml.Text

import java.util.Date

Expand Down Expand Up @@ -99,19 +100,30 @@ private[ui] class StageTableBase(
{s.name}
</a>

val cachedRddInfos = s.rddInfos.filter(_.numCachedPartitions > 0)
val details = if (s.details.nonEmpty) {
<span onclick="this.parentNode.querySelector('.stage-details').classList.toggle('collapsed')"
class="expand-details">
+show details
</span>
<pre class="stage-details collapsed">{s.details}</pre>
+details
</span> ++
<div class="stage-details collapsed">
{if (cachedRddInfos.nonEmpty) {
Text("RDD: ") ++
// scalastyle:off
cachedRddInfos.map { i =>
<a href={"%s/storage/rdd?id=%d".format(UIUtils.prependBaseUri(basePath), i.id)}>{i.name}</a>
}
// scalastyle:on
}}
<pre>{s.details}</pre>
</div>
}

val stageDataOption = listener.stageIdToData.get(s.stageId)
// Too many nested map/flatMaps with options are just annoying to read. Do this imperatively.
if (stageDataOption.isDefined && stageDataOption.get.description.isDefined) {
val desc = stageDataOption.get.description
<div><em>{desc}</em></div><div>{nameLink} {killLink}</div>
<div><em>{desc}</em></div><div>{killLink} {nameLink} {details}</div>
} else {
<div>{killLink} {nameLink} {details}</div>
}
Expand Down

0 comments on commit fec641b

Please sign in to comment.