@@ -35,7 +35,6 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
35
35
Option (request.getParameter(" showIncomplete" )).getOrElse(" false" ).toBoolean
36
36
37
37
val allApps = parent.getApplicationList()
38
- .filter(_.attempts.head.completed != requestedIncomplete)
39
38
val allAppsSize = allApps.size
40
39
41
40
val actualFirst = if (requestedFirst < allAppsSize) requestedFirst else 0
@@ -51,9 +50,15 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
51
50
val hasMultipleAttempts = appsToShow.exists(_.attempts.size > 1 )
52
51
val appTable =
53
52
if (hasMultipleAttempts) {
54
- UIUtils .listingTable(appWithAttemptHeader, appWithAttemptRow, appsToShow)
53
+ UIUtils .listingTable(
54
+ appWithAttemptHeader,
55
+ appWithAttemptRow(_, requestedIncomplete),
56
+ appsToShow)
55
57
} else {
56
- UIUtils .listingTable(appHeader, appRow, appsToShow)
58
+ UIUtils .listingTable(
59
+ appHeader,
60
+ appRow(_, requestedIncomplete),
61
+ appsToShow)
57
62
}
58
63
59
64
val providerConfig = parent.getProviderConfig()
@@ -157,7 +162,8 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
157
162
renderAttemptIdColumn : Boolean ,
158
163
info : ApplicationHistoryInfo ,
159
164
attempt : ApplicationAttemptInfo ,
160
- isFirst : Boolean ): Seq [Node ] = {
165
+ isFirst : Boolean ,
166
+ requestedIncomplete : Boolean ): Seq [Node ] = {
161
167
val uiAddress = HistoryServer .getAttemptURI(info.id, attempt.attemptId)
162
168
val startTime = UIUtils .formatDate(attempt.startTime)
163
169
val endTime = if (attempt.endTime > 0 ) UIUtils .formatDate(attempt.endTime) else " -"
@@ -168,6 +174,10 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
168
174
" -"
169
175
}
170
176
val lastUpdated = UIUtils .formatDate(attempt.lastUpdated)
177
+ var someAttemptCompleted = false
178
+ info.attempts.foreach{ attempt =>
179
+ if (attempt.completed) someAttemptCompleted = true
180
+ }
171
181
<tr >
172
182
{
173
183
if (isFirst) {
@@ -185,7 +195,8 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
185
195
}
186
196
}
187
197
{
188
- if (renderAttemptIdColumn) {
198
+ if (renderAttemptIdColumn &&
199
+ (requestedIncomplete || (! requestedIncomplete && someAttemptCompleted))) {
189
200
if (info.attempts.size > 1 && attempt.attemptId.isDefined) {
190
201
<td ><a href ={HistoryServer .getAttemptURI(info.id, attempt.attemptId)}>
191
202
{attempt.attemptId.get}</a ></td >
@@ -196,22 +207,34 @@ private[history] class HistoryPage(parent: HistoryServer) extends WebUIPage("")
196
207
Nil
197
208
}
198
209
}
199
- <td sorttable_customkey ={attempt.startTime.toString}>{startTime}</td >
200
- <td sorttable_customkey ={attempt.endTime.toString}>{endTime}</td >
201
- <td sorttable_customkey ={(attempt.endTime - attempt.startTime).toString}>
202
- {duration}</td >
203
- <td >{attempt.sparkUser}</td >
204
- <td sorttable_customkey ={attempt.lastUpdated.toString}>{lastUpdated}</td >
210
+ {
211
+ if (requestedIncomplete || (! requestedIncomplete && someAttemptCompleted)) {
212
+ <td sorttable_customkey ={attempt.startTime.toString}>{startTime}</td >
213
+ <td sorttable_customkey ={attempt.endTime.toString}>{endTime}</td >
214
+ <td sorttable_customkey ={(attempt.endTime - attempt.startTime).toString}>
215
+ {duration}</td >
216
+ <td >{attempt.sparkUser}</td >
217
+ <td sorttable_customkey ={attempt.lastUpdated.toString}>{lastUpdated}</td >
218
+ } else {
219
+ Nil
220
+ }
221
+ }
205
222
</tr >
206
223
}
207
224
208
- private def appRow (info : ApplicationHistoryInfo ): Seq [Node ] = {
209
- attemptRow(false , info, info.attempts.head, true )
225
+
226
+
227
+ private def appRow (
228
+ info : ApplicationHistoryInfo ,
229
+ requestedIncomplete : Boolean ): Seq [Node ] = {
230
+ attemptRow(false , info, info.attempts.head, true , requestedIncomplete)
210
231
}
211
232
212
- private def appWithAttemptRow (info : ApplicationHistoryInfo ): Seq [Node ] = {
213
- attemptRow(true , info, info.attempts.head, true ) ++
214
- info.attempts.drop(1 ).flatMap(attemptRow(true , info, _, false ))
233
+ private def appWithAttemptRow (
234
+ info : ApplicationHistoryInfo ,
235
+ requestedIncomplete : Boolean ): Seq [Node ] = {
236
+ attemptRow(true , info, info.attempts.head, true , requestedIncomplete) ++
237
+ info.attempts.drop(1 ).flatMap(attemptRow(true , info, _, false , requestedIncomplete))
215
238
}
216
239
217
240
private def makePageLink (linkPage : Int , showIncomplete : Boolean ): String = {
0 commit comments