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

    https://github.com/apache/spark/pull/1222#discussion_r18534494
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -142,48 +151,56 @@ private[history] class FsHistoryProvider(conf: 
SparkConf) extends ApplicationHis
        * Tries to reuse as much of the data already in memory as possible, by 
not reading
        * applications that haven't been updated since last time the logs were 
checked.
        */
    -  private def checkForLogs() = {
    +  private[history] def checkForLogs() = {
         lastLogCheckTimeMs = getMonotonicTimeMs()
         logDebug("Checking for logs. Time is now 
%d.".format(lastLogCheckTimeMs))
    -    try {
    -      val logStatus = fs.listStatus(new Path(resolvedLogDir))
    -      val logDirs = if (logStatus != null) logStatus.filter(_.isDir).toSeq 
else Seq[FileStatus]()
     
    -      // Load all new logs from the log directory. Only directories that 
have a modification time
    -      // later than the last known log directory will be loaded.
    +    def getModificationTime(fsEntry: FileStatus) = {
    +      if (fsEntry.isDir) {
    +        fs.listStatus(fsEntry.getPath).map(_.getModificationTime()).max
    +      } else {
    +        fsEntry.getModificationTime()
    +      }
    +    }
    +
    +    try {
           var newLastModifiedTime = lastModifiedTime
    -      val logInfos = logDirs
    -        .filter { dir =>
    -          if (fs.isFile(new Path(dir.getPath(), 
EventLoggingListener.APPLICATION_COMPLETE))) {
    -            val modTime = getModificationTime(dir)
    +      val logInfos = fs.listStatus(new Path(logDir))
    +        .filter { entry =>
    --- End diff --
    
    That makes the alignment of flatMap / sortBy really weird. Do you have an 
example of what you have in mind so I can follow it? Others I have found follow 
this style.


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