Skip to content

Commit 190c17a

Browse files
committed
StagePage should distinguish no task data, from unknown stage
1 parent 84cd497 commit 190c17a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {
3939
val jobDataOption = listener.jobIdToData.get(jobId)
4040
if (jobDataOption.isEmpty) {
4141
val content =
42-
<div>
42+
<div id="no-info">
4343
<p>No information to display for job {jobId}</p>
4444
</div>
4545
return UIUtils.headerSparkPage(

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,22 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
4646
val stageAttemptId = parameterAttempt.toInt
4747
val stageDataOption = listener.stageIdToData.get((stageId, stageAttemptId))
4848

49-
if (stageDataOption.isEmpty || stageDataOption.get.taskData.isEmpty) {
49+
val stageHeader = s"Details for Stage $stageId (Attempt $stageAttemptId)"
50+
if (stageDataOption.isEmpty) {
51+
val content =
52+
<div id="no-info">
53+
<p>No information to display for Stage {stageId} (Attempt {stageAttemptId})</p>
54+
</div>
55+
return UIUtils.headerSparkPage(stageHeader, content, parent)
56+
57+
}
58+
if (stageDataOption.get.taskData.isEmpty) {
5059
val content =
5160
<div>
5261
<h4>Summary Metrics</h4> No tasks have started yet
5362
<h4>Tasks</h4> No tasks have started yet
5463
</div>
55-
return UIUtils.headerSparkPage(
56-
s"Details for Stage $stageId (Attempt $stageAttemptId)", content, parent)
64+
return UIUtils.headerSparkPage(stageHeader, content, parent)
5765
}
5866

5967
val stageData = stageDataOption.get
@@ -442,7 +450,7 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
442450
maybeAccumulableTable ++
443451
<h4>Tasks</h4> ++ taskTable
444452

445-
UIUtils.headerSparkPage("Details for Stage %d".format(stageId), content, parent)
453+
UIUtils.headerSparkPage(stageHeader, content, parent)
446454
}
447455
}
448456

0 commit comments

Comments
 (0)