Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4311#discussion_r25105177
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala ---
    @@ -31,15 +33,25 @@ private[spark] class HistoryPage(parent: HistoryServer) 
extends WebUIPage("") {
         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(actualFirst + pageSize, 
allApps.size))
    -
    +    val applicationNattemptsList = parent.getApplicationList()
    +    val (hasAttemptInfo, appToAttemptMap)  = 
getApplicationLevelList(applicationNattemptsList)
    +    val allAppsSize = if(hasAttemptInfo) appToAttemptMap.size else 
applicationNattemptsList.size
    +    val actualFirst = if (requestedFirst < allAppsSize) requestedFirst 
else 0
    +    val apps = applicationNattemptsList.slice(actualFirst, 
    +                                              Math.min(actualFirst + 
pageSize,
    +                                              allAppsSize))
    +    val appWithAttemptsDisplayList = appToAttemptMap.slice(actualFirst, 
    +                                                           
Math.min(actualFirst + pageSize,
    +                                                           allAppsSize))
         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 last = Math.min(actualFirst + pageSize, allAppsSize) - 1
    +    val pageCount = allAppsSize / pageSize + (if (allAppsSize % pageSize > 
0) 1 else 0)
    + 
    +     val appTable = if(hasAttemptInfo ) 
UIUtils.listingTable(appWithAttemptHeader,
    --- End diff --
    
    val appTable =
      if (hasAttemptInfo) {
        UIUtils.listingTable(...)
      } else {
        UIUtils.listingTable(...)
      }


---
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]

Reply via email to