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

    https://github.com/apache/spark/pull/4311#discussion_r25104823
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -166,21 +167,65 @@ private[history] class FsHistoryProvider(conf: 
SparkConf) extends ApplicationHis
                 newLastModifiedTime = math.max(newLastModifiedTime, modTime)
                 modTime > lastModifiedTime
               } else {
    -            false
    +            val appLogStatus = fs.listStatus(new 
Path(dir.getPath().toUri()))
    +            val appAttemptsDirs = if (appLogStatus != null) 
appLogStatus.filter(_.isDir).toSeq 
    +                                  else Seq[FileStatus]()
    +            var isValidApplicationLogToUpdate = false
    +            breakable {
    +                for (appAttemptDir <- appAttemptsDirs){
    +                    // There are multiple attempts inside this application 
logs
    +                    if (fs.isFile(new Path(appAttemptDir.getPath(),
    +                                           
EventLoggingListener.APPLICATION_COMPLETE))) {
    +                      val modTime = getModificationTime(dir)
    +                      newLastModifiedTime = math.max(newLastModifiedTime, 
modTime)
    +                      isValidApplicationLogToUpdate = modTime > 
lastModifiedTime
    +                      break
    +                    }
    +                }
    +            }
    --- End diff --
    
    please do not use break here. While it's unnatural that Scala does not 
provide native support for breaks, we try to avoid breaks elsewhere in the code 
base because it requires us to wrap the code in a `breakable` block. Here you 
can just use a while loop with a boolean var instead.


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