spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] vanzin commented on a change in pull request #27208: [SPARK-30481][CORE] Integrate event log compactor into Spark History Server
Date Wed, 15 Jan 2020 22:55:59 GMT
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message