iotdb-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [iotdb] THUMarkLau commented on a change in pull request #3447: [ISSUE 3445] New compaction strategy and compaction scheduling strategy
Date Mon, 02 Aug 2021 15:00:51 GMT

THUMarkLau commented on a change in pull request #3447:
URL: https://github.com/apache/iotdb/pull/3447#discussion_r681046078



##########
File path: server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/CompactionUtils.java
##########
@@ -477,9 +484,79 @@ private static void modifyChunkMetaDataWithCache(
     for (Modification modification : modifications) {
       if (modification.getPath().matchFullPath(seriesPath)) {
         seriesModifications.add(modification);
-        usedModifications.add(modification);
       }
     }
     modifyChunkMetaData(chunkMetadataList, seriesModifications);
   }
+
+  private static boolean isFileListHasModifications(
+      Set<TsFileSequenceReader> readers, Map<String, List<Modification>>
modificationCache) {
+    for (TsFileSequenceReader reader : readers) {
+      if (!getModifications(reader, modificationCache).isEmpty()) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  private static List<Modification> getModifications(
+      TsFileSequenceReader reader, Map<String, List<Modification>> modificationCache)
{
+    return modificationCache.computeIfAbsent(
+        reader.getFileName(),
+        fileName ->
+            new LinkedList<>(
+                new ModificationFile(fileName + ModificationFile.FILE_SUFFIX).getModifications()));
+  }
+
+  public static ModificationFile getModificationByPath(String filePath) {

Review comment:
       fixed




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

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message