Skip to content
Snippets Groups Projects
Commit 099528b6 authored by Karen Feng's avatar Karen Feng
Browse files

Pre-sorts stage/env tables, changes text/link of stage summaries

parent 254a9307
No related branches found
No related tags found
No related merge requests found
...@@ -44,22 +44,22 @@ private[spark] class EnvironmentUI(sc: SparkContext) { ...@@ -44,22 +44,22 @@ private[spark] class EnvironmentUI(sc: SparkContext) {
("Java Home", Properties.javaHome), ("Java Home", Properties.javaHome),
("Scala Version", Properties.versionString), ("Scala Version", Properties.versionString),
("Scala Home", Properties.scalaHome) ("Scala Home", Properties.scalaHome)
) ).sorted
def jvmRow(kv: (String, String)) = <tr><td>{kv._1}</td><td>{kv._2}</td></tr> def jvmRow(kv: (String, String)) = <tr><td>{kv._1}</td><td>{kv._2}</td></tr>
def jvmTable = UIUtils.listingTable(Seq("Name", "Value"), jvmRow, jvmInformation.sorted) def jvmTable = UIUtils.listingTable(Seq("Name", "Value"), jvmRow, jvmInformation)
val properties = System.getProperties.iterator.toSeq val properties = System.getProperties.iterator.toSeq
val classPathProperty = properties val classPathProperty = properties
.filter{case (k, v) => k.contains("java.class.path")} .filter{case (k, v) => k.contains("java.class.path")}
.headOption .headOption
.getOrElse("", "") .getOrElse("", "")
val sparkProperties = properties.filter(_._1.startsWith("spark")) val sparkProperties = properties.filter(_._1.startsWith("spark")).sorted
val otherProperties = properties.diff(sparkProperties :+ classPathProperty) val otherProperties = properties.diff(sparkProperties :+ classPathProperty).sorted
val propertyHeaders = Seq("Name", "Value") val propertyHeaders = Seq("Name", "Value")
def propertyRow(kv: (String, String)) = <tr><td>{kv._1}</td><td>{kv._2}</td></tr> def propertyRow(kv: (String, String)) = <tr><td>{kv._1}</td><td>{kv._2}</td></tr>
val sparkPropertyTable = UIUtils.listingTable(propertyHeaders, propertyRow, sparkProperties.sorted) val sparkPropertyTable = UIUtils.listingTable(propertyHeaders, propertyRow, sparkProperties)
val otherPropertyTable = UIUtils.listingTable(propertyHeaders, propertyRow, otherProperties.sorted) val otherPropertyTable = UIUtils.listingTable(propertyHeaders, propertyRow, otherProperties)
val classPathEntries = classPathProperty._2 val classPathEntries = classPathProperty._2
.split(System.getProperty("path.separator", ":")) .split(System.getProperty("path.separator", ":"))
...@@ -67,11 +67,11 @@ private[spark] class EnvironmentUI(sc: SparkContext) { ...@@ -67,11 +67,11 @@ private[spark] class EnvironmentUI(sc: SparkContext) {
.map(e => (e, "System Classpath")) .map(e => (e, "System Classpath"))
val addedJars = sc.addedJars.iterator.toSeq.map{case (path, time) => (path, "Added By User")} val addedJars = sc.addedJars.iterator.toSeq.map{case (path, time) => (path, "Added By User")}
val addedFiles = sc.addedFiles.iterator.toSeq.map{case (path, time) => (path, "Added By User")} val addedFiles = sc.addedFiles.iterator.toSeq.map{case (path, time) => (path, "Added By User")}
val classPath = addedJars ++ addedFiles ++ classPathEntries val classPath = (addedJars ++ addedFiles ++ classPathEntries).sorted
val classPathHeaders = Seq("Resource", "Source") val classPathHeaders = Seq("Resource", "Source")
def classPathRow(data: (String, String)) = <tr><td>{data._1}</td><td>{data._2}</td></tr> def classPathRow(data: (String, String)) = <tr><td>{data._1}</td><td>{data._2}</td></tr>
val classPathTable = UIUtils.listingTable(classPathHeaders, classPathRow, classPath.sorted) val classPathTable = UIUtils.listingTable(classPathHeaders, classPathRow, classPath)
val content = val content =
<span> <span>
......
...@@ -41,9 +41,9 @@ private[spark] class IndexPage(parent: JobProgressUI) { ...@@ -41,9 +41,9 @@ private[spark] class IndexPage(parent: JobProgressUI) {
activeTime += t.timeRunning(now) activeTime += t.timeRunning(now)
} }
val activeStagesTable = new StageTable(activeStages, parent) val activeStagesTable = new StageTable(activeStages.sortBy(_.submissionTime).reverse, parent)
val completedStagesTable = new StageTable(completedStages, parent) val completedStagesTable = new StageTable(completedStages.sortBy(_.submissionTime).reverse, parent)
val failedStagesTable = new StageTable(failedStages, parent) val failedStagesTable = new StageTable(failedStages.sortBy(_.submissionTime).reverse, parent)
val poolTable = new PoolTable(listener.sc.getAllPools, listener) val poolTable = new PoolTable(listener.sc.getAllPools, listener)
val summary: NodeSeq = val summary: NodeSeq =
...@@ -69,18 +69,18 @@ private[spark] class IndexPage(parent: JobProgressUI) { ...@@ -69,18 +69,18 @@ private[spark] class IndexPage(parent: JobProgressUI) {
{Utils.memoryBytesToString(listener.totalShuffleWrite)} {Utils.memoryBytesToString(listener.totalShuffleWrite)}
</li> </li>
} }
<li><a href="#active"> <li>
<strong>Active Stages Number:</strong> <a href="#active"><strong>Active Stages:</strong></a>
{activeStages.size} {activeStages.size}
</a></li> </li>
<li><a href="#completed"> <li>
<strong>Completed Stages Number:</strong> <a href="#completed"><strong>Completed Stages:</strong></a>
{completedStages.size} {completedStages.size}
</a></li> </li>
<li><a href="#failed"> <li>
<strong>Failed Stages Number:</strong> <a href="#failed"><strong>Failed Stages:</strong></a>
{failedStages.size} {failedStages.size}
</a></li> </li>
<li><strong>Scheduling Mode:</strong> {parent.sc.getSchedulingMode}</li> <li><strong>Scheduling Mode:</strong> {parent.sc.getSchedulingMode}</li>
</ul> </ul>
</div> </div>
......
...@@ -17,7 +17,7 @@ private[spark] class PoolPage(parent: JobProgressUI) { ...@@ -17,7 +17,7 @@ private[spark] class PoolPage(parent: JobProgressUI) {
val poolName = request.getParameter("poolname") val poolName = request.getParameter("poolname")
val poolToActiveStages = listener.poolToActiveStages val poolToActiveStages = listener.poolToActiveStages
val activeStages = poolToActiveStages.getOrElseUpdate(poolName, new HashSet[Stage]).toSeq val activeStages = poolToActiveStages.getOrElseUpdate(poolName, new HashSet[Stage]).toSeq
val activeStagesTable = new StageTable(activeStages, parent) val activeStagesTable = new StageTable(activeStages.sortBy(_.submissionTime).reverse, parent)
val pool = listener.sc.getPoolForName(poolName).get val pool = listener.sc.getPoolForName(poolName).get
val poolTable = new PoolTable(Seq(pool), listener) val poolTable = new PoolTable(Seq(pool), listener)
......
...@@ -25,7 +25,7 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU ...@@ -25,7 +25,7 @@ private[spark] class StageTable(val stages: Seq[Stage], val parent: JobProgressU
val isFairScheduler = listener.sc.getSchedulingMode == SchedulingMode.FAIR val isFairScheduler = listener.sc.getSchedulingMode == SchedulingMode.FAIR
def toNodeSeq(): Seq[Node] = { def toNodeSeq(): Seq[Node] = {
stageTable(stageRow, stages.sortBy(_.submissionTime).reverse) stageTable(stageRow, stages)
} }
/** Special table which merges two header cells. */ /** Special table which merges two header cells. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment