vanzin commented on a change in pull request #27208: [SPARK-30481][CORE]
Integrate event log compactor into Spark History Server
URL: https://github.com/apache/spark/pull/27208#discussion_r367137498
##########
File path:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
##########
@@ -569,6 +570,35 @@ private[history] class FsHistoryProvider(conf: SparkConf,
clock: Clock)
}
}
+ /**
+ * Returns a tuple containing two values. Each element means:
+ * - 1st (Boolean): true if the list of event log files are changed, false
otherwise.
+ * - 2nd (Option[Long]): Some(value) if the method succeeds to try
compaction,
+ * value indicates the last event log index to try compaction. None
otherwise.
+ */
+ private def compact(reader: EventLogFileReader): (Boolean, Option[Long]) = {
+ reader.lastIndex match {
+ case Some(lastIndex) =>
+ try {
+ val info = listing.read(classOf[LogInfo], reader.rootPath.toString)
+ if (info.lastIndexToRunCompaction.isEmpty ||
+ info.lastIndexToRunCompaction.get < lastIndex) {
Review comment:
indent more
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]