Skip to content
Snippets Groups Projects
Commit a68ecf32 authored by Mark Mims's avatar Mark Mims Committed by Josh Rosen
Browse files

[SPARK-4141] Hide Accumulators column on stage page when no accumulators exist

WebUI

Author: Mark Mims <mark.mims@canonical.com>

This patch had conflicts when merged, resolved by
Committer: Josh Rosen <joshrosen@databricks.com>

Closes #3031 from mmm/remove-accumulators-col and squashes the following commits:

6141cb3 [Mark Mims] reformat to satisfy scalastyle linelength.  build failed from jenkins https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22604/
390893b [Mark Mims] cleanup
c28c449 [Mark Mims] looking much better now... minimal explicit formatting.  Now, see if any sort keys make sense
fb72156 [Mark Mims] mimic hasInput.  The basics work here, but wanna clean this up with maybeAccumulators for column content
parent 23468e7e
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") { ...@@ -53,6 +53,7 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
val numCompleted = tasks.count(_.taskInfo.finished) val numCompleted = tasks.count(_.taskInfo.finished)
val accumulables = listener.stageIdToData((stageId, stageAttemptId)).accumulables val accumulables = listener.stageIdToData((stageId, stageAttemptId)).accumulables
val hasAccumulators = accumulables.size > 0
val hasInput = stageData.inputBytes > 0 val hasInput = stageData.inputBytes > 0
val hasShuffleRead = stageData.shuffleReadBytes > 0 val hasShuffleRead = stageData.shuffleReadBytes > 0
val hasShuffleWrite = stageData.shuffleWriteBytes > 0 val hasShuffleWrite = stageData.shuffleWriteBytes > 0
...@@ -144,11 +145,12 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") { ...@@ -144,11 +145,12 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
val taskHeadersAndCssClasses: Seq[(String, String)] = val taskHeadersAndCssClasses: Seq[(String, String)] =
Seq( Seq(
("Index", ""), ("ID", ""), ("Attempt", ""), ("Status", ""), ("Locality Level", ""), ("Index", ""), ("ID", ""), ("Attempt", ""), ("Status", ""), ("Locality Level", ""),
("Executor ID / Host", ""), ("Launch Time", ""), ("Duration", ""), ("Accumulators", ""), ("Executor ID / Host", ""), ("Launch Time", ""), ("Duration", ""),
("Scheduler Delay", TaskDetailsClassNames.SCHEDULER_DELAY), ("Scheduler Delay", TaskDetailsClassNames.SCHEDULER_DELAY),
("GC Time", TaskDetailsClassNames.GC_TIME), ("GC Time", TaskDetailsClassNames.GC_TIME),
("Result Serialization Time", TaskDetailsClassNames.RESULT_SERIALIZATION_TIME), ("Result Serialization Time", TaskDetailsClassNames.RESULT_SERIALIZATION_TIME),
("Getting Result Time", TaskDetailsClassNames.GETTING_RESULT_TIME)) ++ ("Getting Result Time", TaskDetailsClassNames.GETTING_RESULT_TIME)) ++
{if (hasAccumulators) Seq(("Accumulators", "")) else Nil} ++
{if (hasInput) Seq(("Input", "")) else Nil} ++ {if (hasInput) Seq(("Input", "")) else Nil} ++
{if (hasShuffleRead) Seq(("Shuffle Read", "")) else Nil} ++ {if (hasShuffleRead) Seq(("Shuffle Read", "")) else Nil} ++
{if (hasShuffleWrite) Seq(("Write Time", ""), ("Shuffle Write", "")) else Nil} ++ {if (hasShuffleWrite) Seq(("Write Time", ""), ("Shuffle Write", "")) else Nil} ++
...@@ -159,7 +161,9 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") { ...@@ -159,7 +161,9 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
val unzipped = taskHeadersAndCssClasses.unzip val unzipped = taskHeadersAndCssClasses.unzip
val taskTable = UIUtils.listingTable( val taskTable = UIUtils.listingTable(
unzipped._1, taskRow(hasInput, hasShuffleRead, hasShuffleWrite, hasBytesSpilled), tasks, unzipped._1,
taskRow(hasAccumulators, hasInput, hasShuffleRead, hasShuffleWrite, hasBytesSpilled),
tasks,
headerClasses = unzipped._2) headerClasses = unzipped._2)
// Excludes tasks which failed and have incomplete metrics // Excludes tasks which failed and have incomplete metrics
val validTasks = tasks.filter(t => t.taskInfo.status == "SUCCESS" && t.taskMetrics.isDefined) val validTasks = tasks.filter(t => t.taskInfo.status == "SUCCESS" && t.taskMetrics.isDefined)
...@@ -298,6 +302,7 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") { ...@@ -298,6 +302,7 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
} }
def taskRow( def taskRow(
hasAccumulators: Boolean,
hasInput: Boolean, hasInput: Boolean,
hasShuffleRead: Boolean, hasShuffleRead: Boolean,
hasShuffleWrite: Boolean, hasShuffleWrite: Boolean,
...@@ -312,6 +317,9 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") { ...@@ -312,6 +317,9 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
val serializationTime = metrics.map(_.resultSerializationTime).getOrElse(0L) val serializationTime = metrics.map(_.resultSerializationTime).getOrElse(0L)
val gettingResultTime = info.gettingResultTime val gettingResultTime = info.gettingResultTime
val maybeAccumulators = info.accumulables
val accumulatorsReadable = maybeAccumulators.map{acc => s"${acc.name}: ${acc.update.get}"}
val maybeInput = metrics.flatMap(_.inputMetrics) val maybeInput = metrics.flatMap(_.inputMetrics)
val inputSortable = maybeInput.map(_.bytesRead.toString).getOrElse("") val inputSortable = maybeInput.map(_.bytesRead.toString).getOrElse("")
val inputReadable = maybeInput val inputReadable = maybeInput
...@@ -355,10 +363,6 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") { ...@@ -355,10 +363,6 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
<td sorttable_customkey={duration.toString}> <td sorttable_customkey={duration.toString}>
{formatDuration} {formatDuration}
</td> </td>
<td>
{Unparsed(
info.accumulables.map{acc => s"${acc.name}: ${acc.update.get}"}.mkString("<br/>"))}
</td>
<td sorttable_customkey={schedulerDelay.toString} <td sorttable_customkey={schedulerDelay.toString}
class={TaskDetailsClassNames.SCHEDULER_DELAY}> class={TaskDetailsClassNames.SCHEDULER_DELAY}>
{UIUtils.formatDuration(schedulerDelay.toLong)} {UIUtils.formatDuration(schedulerDelay.toLong)}
...@@ -374,6 +378,11 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") { ...@@ -374,6 +378,11 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
class={TaskDetailsClassNames.GETTING_RESULT_TIME}> class={TaskDetailsClassNames.GETTING_RESULT_TIME}>
{UIUtils.formatDuration(gettingResultTime)} {UIUtils.formatDuration(gettingResultTime)}
</td> </td>
{if (hasAccumulators) {
<td>
{Unparsed(accumulatorsReadable.mkString("<br/>"))}
</td>
}}
{if (hasInput) { {if (hasInput) {
<td sorttable_customkey={inputSortable}> <td sorttable_customkey={inputSortable}>
{inputReadable} {inputReadable}
......
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