Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/5432#discussion_r29231263
--- Diff:
core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala ---
@@ -34,18 +37,28 @@ private[history] class HistoryPage(parent:
HistoryServer) extends WebUIPage("")
val requestedIncomplete =
Option(request.getParameter("showIncomplete")).getOrElse("false").toBoolean
- val allApps = parent.getApplicationList().filter(_.completed !=
requestedIncomplete)
- val actualFirst = if (requestedFirst < allApps.size) requestedFirst
else 0
- val apps = allApps.slice(actualFirst, Math.min(actualFirst + pageSize,
allApps.size))
+ val allApps = parent.getApplicationList()
+ .filter(_.attempts.head.completed != requestedIncomplete)
+ val allAppsSize = allApps.size
+
+ val actualFirst = if (requestedFirst < allAppsSize) requestedFirst
else 0
+ val appsToShow = allApps.slice(actualFirst, Math.min(actualFirst +
pageSize, allAppsSize))
--- End diff --
I realize you didn't add this, but the `Math.min` isn't necessary:
```
scala> (1 to 10).slice(5,20)
res0: scala.collection.immutable.IndexedSeq[Int] = Vector(6, 7, 8, 9, 10)
```
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]