Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/6935#discussion_r47574113
--- Diff:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
@@ -430,8 +517,55 @@ private[history] class FsHistoryProvider(conf:
SparkConf, clock: Clock)
}
newIterator.foreach(addIfAbsent)
oldIterator.foreach(addIfAbsent)
+ mergedApps
+ }
+
+
+ /**
+ * Scan through all known incomplete applications, and check for any
that have been updated.
+ *
+ * After the scan, if there were any updated attempts, [[applications]]
is updated
+ * with the new values.
+ *
+ * 1. No attempt to replay the application is made; this scan is a low
cost operation.
+ * 2. As this overwrites [[applications]] with a new value, it must not
run concurrently
+ * with the main scan for new applications. That is: it must be in the
[[checkForLogs()]]
+ * operation.
+ */
+ private[history] def scanAndUpdateIncompleteAttemptInfo(): Unit = {
+ val newAttempts: Iterable[FsApplicationAttemptInfo] = applications
+ .filter( e => !e._2.completed)
+ .flatMap { e =>
+ // build list of (false, attempt) or (true, attempt') values
+ e._2.attempts.flatMap { prevInfo: FsApplicationAttemptInfo =>
+ val path = new Path(logDir, prevInfo.logPath)
+ try {
+ val status = fs.getFileStatus(path)
+ val size = getLogSize(status).getOrElse(-1L)
+ val aS = prevInfo.fileSize
+ if (size > aS) {
+ logDebug(s"Attempt ${prevInfo.name}/${prevInfo.appId} size
=> $size")
+ Some(new FsApplicationAttemptInfo(prevInfo.logPath,
prevInfo.name, prevInfo.appId,
+ prevInfo.attemptId, prevInfo.startTime,
prevInfo.endTime, prevInfo.lastUpdated,
+ prevInfo.sparkUser, prevInfo.completed, size,
attemptCounter.incrementAndGet()))
--- End diff --
since you're only using filesize now, do you need the attemptCounter?
Can't you just use filesize? It seems like it will work exactly the same. And
you still let other providers use something else entirely, since the counter
was also local to FsHistoryProvider
---
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]