Skip to content

Commit 287440d

Browse files
jerryshaocloud-fan
authored andcommitted
[SPARK-20275][UI] Do not display "Completed" column for in-progress applications
## What changes were proposed in this pull request? Current HistoryServer will display completed date of in-progress application as `1969-12-31 23:59:59`, which is not so meaningful. Instead of unnecessarily showing this incorrect completed date, here propose to make this column invisible for in-progress applications. The purpose of only making this column invisible rather than deleting this field is that: this data is fetched through REST API, and in the REST API the format is like below shows, in which `endTime` matches `endTimeEpoch`. So instead of changing REST API to break backward compatibility, here choosing a simple solution to only make this column invisible. ``` [ { "id" : "local-1491805439678", "name" : "Spark shell", "attempts" : [ { "startTime" : "2017-04-10T06:23:57.574GMT", "endTime" : "1969-12-31T23:59:59.999GMT", "lastUpdated" : "2017-04-10T06:23:57.574GMT", "duration" : 0, "sparkUser" : "", "completed" : false, "startTimeEpoch" : 1491805437574, "endTimeEpoch" : -1, "lastUpdatedEpoch" : 1491805437574 } ] } ]% ``` Here is UI before changed: <img width="1317" alt="screen shot 2017-04-10 at 3 45 57 pm" src="https://cloud.githubusercontent.com/assets/850797/24851938/17d46cc0-1e08-11e7-84c7-90120e171b41.png"> And after: <img width="1281" alt="screen shot 2017-04-10 at 4 02 35 pm" src="https://cloud.githubusercontent.com/assets/850797/24851945/1fe9da58-1e08-11e7-8d0d-9262324f9074.png"> ## How was this patch tested? Manual verification. Author: jerryshao <sshao@hortonworks.com> Closes #17588 from jerryshao/SPARK-20275. (cherry picked from commit 52ed9b2) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
1 parent 5fdc7d8 commit 287440d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

core/src/main/resources/org/apache/spark/ui/static/historypage-template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
Started
4040
</span>
4141
</th>
42-
<th>
42+
<th class="completedColumn">
4343
<span data-toggle="tooltip" data-placement="above" title="The completed time of this application.">
4444
Completed
4545
</span>
@@ -73,7 +73,7 @@
7373
{{#attempts}}
7474
<td class="attemptIDSpan"><a href="{{uiroot}}/history/{{id}}/{{attemptId}}/jobs/">{{attemptId}}</a></td>
7575
<td>{{startTime}}</td>
76-
<td>{{endTime}}</td>
76+
<td class="completedColumn">{{endTime}}</td>
7777
<td><span title="{{duration}}" class="durationClass">{{duration}}</span></td>
7878
<td>{{sparkUser}}</td>
7979
<td>{{lastUpdated}}</td>

core/src/main/resources/org/apache/spark/ui/static/historypage.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ $(document).ready(function() {
177177
}
178178
}
179179

180+
if (requestedIncomplete) {
181+
var completedCells = document.getElementsByClassName("completedColumn");
182+
for (i = 0; i < completedCells.length; i++) {
183+
completedCells[i].style.display='none';
184+
}
185+
}
186+
180187
var durationCells = document.getElementsByClassName("durationClass");
181188
for (i = 0; i < durationCells.length; i++) {
182189
var timeInMilliseconds = parseInt(durationCells[i].title);

0 commit comments

Comments
 (0)