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

    https://github.com/apache/spark/pull/4525#discussion_r25490429
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -187,47 +200,74 @@ private[history] class FsHistoryProvider(conf: 
SparkConf) extends ApplicationHis
             }
             .flatMap { entry =>
               try {
    -            Some(replay(entry, new ReplayListenerBus()))
    +            Some((getModificationTime(entry).get, entry))
               } catch {
                 case e: Exception =>
                   logError(s"Failed to load application log data from 
$entry.", e)
                   None
               }
             }
    -        .sortWith(compareAppInfo)
    +        .sortWith(_._1 >= _._1)
    +        .map { case (_, file) => file }
    --- End diff --
    
    I think you can replace these three cases (the flatMap, sortWith, and map) 
with a single one.
    ```
    val logInfos: Seq[FileStatus] = statusList
      .filter { ... }
      .sortWith { case (entry1, entry2) =>
        val mod1 = getModificationTime(entry1).getOrElse(-1)
        val mod2 = getModificationTime(entry1).getOrElse(-1)
        mod1 >= mod2
      }
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to