Skip to content

Commit 9d7b593

Browse files
author
guliangliang
committed
[SPARK-5733] Error Link in Pagination of HistroyPage when showing Incomplete Applications
1 parent b8f88d3 commit 9d7b593

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ private[spark] class HistoryPage(parent: HistoryServer) extends WebUIPage("") {
6161
// page, `...` will be displayed.
6262
if (allApps.size > 0) {
6363
val leftSideIndices =
64-
rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _)
64+
rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _, requestedIncomplete)
6565
val rightSideIndices =
66-
rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount)
66+
rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount,
67+
requestedIncomplete)
6768

6869
<h4>
6970
Showing {actualFirst + 1}-{last + 1} of {allApps.size}
@@ -122,8 +123,10 @@ private[spark] class HistoryPage(parent: HistoryServer) extends WebUIPage("") {
122123
"Spark User",
123124
"Last Updated")
124125

125-
private def rangeIndices(range: Seq[Int], condition: Int => Boolean): Seq[Node] = {
126-
range.filter(condition).map(nextPage => <a href={"/?page=" + nextPage}> {nextPage} </a>)
126+
private def rangeIndices(range: Seq[Int], condition: Int => Boolean, showIncomplete: Boolean):
127+
Seq[Node] = {
128+
range.filter(condition).map(nextPage =>
129+
<a href={makePageLink(nextPage, showIncomplete)}> {nextPage} </a>)
127130
}
128131

129132
private def appRow(info: ApplicationHistoryInfo): Seq[Node] = {

0 commit comments

Comments
 (0)