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

    https://github.com/apache/spark/pull/4845#discussion_r25718529
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala ---
    @@ -34,18 +37,31 @@ private[spark] 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 allCompletedAppsNAttempts = 
    +        parent.getApplicationList().filter(_.completed != 
requestedIncomplete)
    +    val (hasAttemptInfo, appToAttemptMap)  = 
getApplicationLevelList(allCompletedAppsNAttempts)
    --- End diff --
    
    Just to make my suggestions a little more concrete, I'm suggesting 
something like this:
    
    - `ApplicationHistoryInfo` becomes `ApplicationAttemptInfo`
    - Add a new `ApplicationHistoryInfo` as follows:
    
        private[spark] class ApplicationHistoryInfo(id: String, attempts: 
Seq[ApplicationAttemptInfo])
    
    - `getListing()` remains unchanged, but note the data it returns is 
different now.
    
    So now you have a list of applications being returned, and each application 
has information about all its attempts. Now it's much easier to slice that list 
and choose what to render in `HistoryPage`. It's a list, so it integrates 
nicely with `UIUtils.listingTable`, unlike the map I suggested before.


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