Skip to content
Snippets Groups Projects
Commit 1ac099e3 authored by guliangliang's avatar guliangliang Committed by Sean Owen
Browse files

[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 <guliangliang@qiyi.com>

Closes #4523 from marsishandsome/Spark5733 and squashes the following commits:

9d7b593 [guliangliang] [SPARK-5733] Error Link in Pagination of HistroyPage when showing Incomplete Applications
parent bd0d6e0c
No related branches found
No related tags found
No related merge requests found
...@@ -61,9 +61,10 @@ private[spark] class HistoryPage(parent: HistoryServer) extends WebUIPage("") { ...@@ -61,9 +61,10 @@ private[spark] class HistoryPage(parent: HistoryServer) extends WebUIPage("") {
// page, `...` will be displayed. // page, `...` will be displayed.
if (allApps.size > 0) { if (allApps.size > 0) {
val leftSideIndices = val leftSideIndices =
rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _) rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _, requestedIncomplete)
val rightSideIndices = val rightSideIndices =
rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount) rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount,
requestedIncomplete)
<h4> <h4>
Showing {actualFirst + 1}-{last + 1} of {allApps.size} Showing {actualFirst + 1}-{last + 1} of {allApps.size}
...@@ -122,8 +123,10 @@ private[spark] class HistoryPage(parent: HistoryServer) extends WebUIPage("") { ...@@ -122,8 +123,10 @@ private[spark] class HistoryPage(parent: HistoryServer) extends WebUIPage("") {
"Spark User", "Spark User",
"Last Updated") "Last Updated")
private def rangeIndices(range: Seq[Int], condition: Int => Boolean): Seq[Node] = { private def rangeIndices(range: Seq[Int], condition: Int => Boolean, showIncomplete: Boolean):
range.filter(condition).map(nextPage => <a href={"/?page=" + nextPage}> {nextPage} </a>) Seq[Node] = {
range.filter(condition).map(nextPage =>
<a href={makePageLink(nextPage, showIncomplete)}> {nextPage} </a>)
} }
private def appRow(info: ApplicationHistoryInfo): Seq[Node] = { private def appRow(info: ApplicationHistoryInfo): Seq[Node] = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment