Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/4311#discussion_r25105114
--- 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
+ }
+ }
+ }
+ isValidApplicationLogToUpdate
}
- }
- .flatMap { dir =>
- try {
- val (replayBus, appListener) = createReplayBus(dir)
- replayBus.replay()
- Some(new FsApplicationHistoryInfo(
- dir.getPath().getName(),
- appListener.appId.getOrElse(dir.getPath().getName()),
- appListener.appName.getOrElse(NOT_STARTED),
- appListener.startTime.getOrElse(-1L),
- appListener.endTime.getOrElse(-1L),
- getModificationTime(dir),
- appListener.sparkUser.getOrElse(NOT_STARTED)))
+ }
+ .flatMap { dir =>
+ val appAttemptsApplicationHistoryInfo =
+ new
scala.collection.mutable.ArrayBuffer[FsApplicationHistoryInfo]()
+ try {
+ if (!fs.isFile(new Path(dir.getPath(),
EventLoggingListener.APPLICATION_COMPLETE))) {
+ // There are multiple attempts inside this application logs
+ val appLogStatus = fs.listStatus(new
Path(dir.getPath().toUri()))
+ val appAttemptSubDirs:Seq[FileStatus] =
+ if (appLogStatus != null)
appLogStatus.filter(_.isDir).toSeq else Seq[FileStatus]()
+
+ for (appAttemptDir <- appAttemptSubDirs){
+ // There are multiple attempts inside this application logs
+ if (fs.isFile(new Path(appAttemptDir.getPath(),
+
EventLoggingListener.APPLICATION_COMPLETE))) {
+ val (replayBus, appListener) =
createReplayBus(appAttemptDir)
+ replayBus.replay()
+ appAttemptsApplicationHistoryInfo += new
FsApplicationHistoryInfo(
+ dir.getPath().getName() + "/" +
appAttemptDir.getPath().getName(),
+ dir.getPath().getName() + "_attemptid_" +
appAttemptDir.getPath().getName(),
+ appListener.appName.getOrElse(NOT_STARTED),
+ appListener.startTime.getOrElse(-1L),
+ appListener.endTime.getOrElse(-1L),
+ getModificationTime(dir),
+ appListener.sparkUser.getOrElse(NOT_STARTED))
+ }
+ }
+
+ } else {
+ val (replayBus, appListener) = createReplayBus(dir)
+ replayBus.replay()
+ appAttemptsApplicationHistoryInfo += new
FsApplicationHistoryInfo(
+ dir.getPath().getName(),
+ appListener.appId.getOrElse(dir.getPath().getName()),
+ appListener.appName.getOrElse(NOT_STARTED),
+ appListener.startTime.getOrElse(-1L),
+ appListener.endTime.getOrElse(-1L),
+ getModificationTime(dir),
+ appListener.sparkUser.getOrElse(NOT_STARTED))
--- End diff --
this is indented too much. Please use 2 spaces 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]