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

    https://github.com/apache/spark/pull/15556#discussion_r84694679
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -399,20 +396,26 @@ private[history] class FsHistoryProvider(conf: 
SparkConf, clock: Clock)
         }
       }
     
    -
       /**
        * Replay the log files in the list and merge the list of old 
applications with new ones
        */
       private def mergeApplicationListing(fileStatus: FileStatus): Unit = {
         val newAttempts = try {
             val bus = new ReplayListenerBus()
    -        val res = replay(fileStatus, bus)
    -        res match {
    -          case Some(r) => logDebug(s"Application log ${r.logPath} loaded 
successfully: $r")
    -          case None => logWarning(s"Failed to load application log 
${fileStatus.getPath}. " +
    -            "The application may have not started.")
    +
    +        val eventsFilter: ReplayEventsFilter = { eventString =>
    +          eventString.startsWith(APPL_START_EVENT_PREFIX) ||
    +            eventString.startsWith(APPL_END_EVENT_PREFIX)
    +        }
    +
    +        val res = replay(fileStatus, bus, eventsFilter)
    +
    +        res.map {
    --- End diff --
    
    Is the idea here to try to get rid of some of the redundancy, because the 
`None` case is kind of addressed twice? 
    
    If it doesn't work to just `return` from the existing `None` case, that's 
simpler. Otherwise, pull up the check? to before this line? otherwise no real 
point in mapping nothing.
    
    And then: map should be foreach, and there's no need to return a value in 
the statement below


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