Skip to content

Commit 0c7b452

Browse files
pwendellrxin
authored andcommitted
SPARK-3020: Print completed indices rather than tasks in web UI
Author: Patrick Wendell <[email protected]> Closes #1933 from pwendell/speculation and squashes the following commits: 33a3473 [Patrick Wendell] Use OpenHashSet 8ce2ff0 [Patrick Wendell] SPARK-3020: Print completed indices rather than tasks in web UI
1 parent 63d6777 commit 0c7b452

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class JobProgressListener(conf: SparkConf) extends SparkListener with Logging {
153153
val (errorMessage, metrics): (Option[String], Option[TaskMetrics]) =
154154
taskEnd.reason match {
155155
case org.apache.spark.Success =>
156+
stageData.completedIndices.add(info.index)
156157
stageData.numCompleteTasks += 1
157158
(None, Option(taskEnd.taskMetrics))
158159
case e: ExceptionFailure => // Handle ExceptionFailure because we might have metrics

core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ private[ui] class StageTableBase(
168168
<td valign="middle">{submissionTime}</td>
169169
<td sorttable_customkey={duration.getOrElse(-1).toString}>{formattedDuration}</td>
170170
<td class="progress-cell">
171-
{makeProgressBar(stageData.numActiveTasks, stageData.numCompleteTasks,
171+
{makeProgressBar(stageData.numActiveTasks, stageData.completedIndices.size,
172172
stageData.numFailedTasks, s.numTasks)}
173173
</td>
174174
<td sorttable_customekey={inputRead.toString}>{inputReadWithUnit}</td>

core/src/main/scala/org/apache/spark/ui/jobs/UIData.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package org.apache.spark.ui.jobs
1919

2020
import org.apache.spark.executor.TaskMetrics
2121
import org.apache.spark.scheduler.{AccumulableInfo, TaskInfo}
22+
import org.apache.spark.util.collection.OpenHashSet
2223

2324
import scala.collection.mutable.HashMap
2425

@@ -38,6 +39,7 @@ private[jobs] object UIData {
3839
class StageUIData {
3940
var numActiveTasks: Int = _
4041
var numCompleteTasks: Int = _
42+
var completedIndices = new OpenHashSet[Int]()
4143
var numFailedTasks: Int = _
4244

4345
var executorRunTime: Long = _

0 commit comments

Comments
 (0)