diff options
author | guliangliang <guliangliang@qiyi.com> | 2015-02-11 15:55:49 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-02-11 15:55:49 +0000 |
commit | 1ac099e3e00ddb01af8e6e3a84c70f8363f04b5c (patch) | |
tree | 75f026660bcff637f4e5b0ba6b96596f5ebddd4b | |
parent | bd0d6e0cc3a329c4a1c08451a6d8a9281a422958 (diff) | |
download | spark-1ac099e3e00ddb01af8e6e3a84c70f8363f04b5c.tar.gz spark-1ac099e3e00ddb01af8e6e3a84c70f8363f04b5c.tar.bz2 spark-1ac099e3e00ddb01af8e6e3a84c70f8363f04b5c.zip |
[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
-rw-r--r-- | core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala b/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala index e4e7bc2216..26ebc75971 100644 --- a/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala +++ b/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala @@ -61,9 +61,10 @@ private[spark] class HistoryPage(parent: HistoryServer) extends WebUIPage("") { // page, `...` will be displayed. if (allApps.size > 0) { val leftSideIndices = - rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _) + rangeIndices(actualPage - plusOrMinus until actualPage, 1 < _, requestedIncomplete) val rightSideIndices = - rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount) + rangeIndices(actualPage + 1 to actualPage + plusOrMinus, _ < pageCount, + requestedIncomplete) <h4> Showing {actualFirst + 1}-{last + 1} of {allApps.size} @@ -122,8 +123,10 @@ private[spark] class HistoryPage(parent: HistoryServer) extends WebUIPage("") { "Spark User", "Last Updated") - private def rangeIndices(range: Seq[Int], condition: Int => Boolean): Seq[Node] = { - range.filter(condition).map(nextPage => <a href={"/?page=" + nextPage}> {nextPage} </a>) + private def rangeIndices(range: Seq[Int], condition: Int => Boolean, showIncomplete: Boolean): + Seq[Node] = { + range.filter(condition).map(nextPage => + <a href={makePageLink(nextPage, showIncomplete)}> {nextPage} </a>) } private def appRow(info: ApplicationHistoryInfo): Seq[Node] = { |