Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/718#discussion_r13570852
--- Diff:
core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala ---
@@ -25,20 +25,32 @@ import org.apache.spark.ui.{WebUIPage, UIUtils}
private[spark] class HistoryPage(parent: HistoryServer) extends
WebUIPage("") {
+ val pageSize = 20
+
def render(request: HttpServletRequest): Seq[Node] = {
- val appRows = parent.appIdToInfo.values.toSeq.sortBy { app =>
-app.lastUpdated }
- val appTable = UIUtils.listingTable(appHeader, appRow, appRows)
+ val requestedPage =
Option(request.getParameter("page")).getOrElse("1").toInt
+ val requestedFirst = (requestedPage - 1) * pageSize
+
+ val allApps = parent.getApplicationList()
+ val actualFirst = if (requestedFirst < allApps.size) requestedFirst
else 0
+ val apps = allApps.slice(actualFirst, Math.min(pageSize, allApps.size))
+
+ val actualPage = (actualFirst / pageSize) + 1
+ val last = Math.min(actualFirst + pageSize, allApps.size) - 1
+ val pageCount = allApps.size / pageSize + (if (allApps.size % pageSize
> 0) 1 else 0)
+
+ val appTable = UIUtils.listingTable(appHeader, appRow, apps)
val content =
<div class="row-fluid">
<div class="span12">
- <ul class="unstyled">
- <li><strong>Event Log Location: </strong>
{parent.baseLogDir}</li>
--- End diff --
I can put it back. I was thinking forward, when the backend storage might
not be the file system at all. But we can remove it then.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---