Skip to content

Commit 1ac099e

Browse files
guliangliangsrowen
authored andcommitted
[SPARK-5733] Error Link in Pagination of HistroyPage when showing Incomplete Applications
The links in pagination of HistroyPage is wrong when showing Incomplete Applications. If "2" is click on the following page "http://history-server:18080/?page=1&showIncomplete=true", it will go to "http://history-server:18080/?page=2" instead of "http://history-server:18080/?page=2&showIncomplete=true". Author: guliangliang <[email protected]> Closes #4523 from marsishandsome/Spark5733 and squashes the following commits: 9d7b593 [guliangliang] [SPARK-5733] Error Link in Pagination of HistroyPage when showing Incomplete Applications
1 parent bd0d6e0 commit 1ac099e

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)