You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ma...@apache.org on 2022/08/25 07:01:31 UTC

[iotdb] branch IOTDB-4225 created (now c8a4692006)

This is an automated email from the ASF dual-hosted git repository.

marklau99 pushed a change to branch IOTDB-4225
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at c8a4692006 do not add mods to cache when mods file does not exist

This branch includes the following new commits:

     new c8a4692006 do not add mods to cache when mods file does not exist

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: do not add mods to cache when mods file does not exist

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

marklau99 pushed a commit to branch IOTDB-4225
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit c8a46920063b93917828f9818c1e62e16805b3c3
Author: Liu Xuxin <li...@outlook.com>
AuthorDate: Thu Aug 25 15:01:16 2022 +0800

    do not add mods to cache when mods file does not exist
---
 .../main/java/org/apache/iotdb/db/query/context/QueryContext.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java b/server/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
index 5ce05c1816..1551a73274 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
@@ -27,6 +27,7 @@ import org.apache.iotdb.db.query.control.QueryTimeManager;
 import org.apache.iotdb.tsfile.file.metadata.IChunkMetadata;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -90,6 +91,10 @@ public class QueryContext {
    * them from 'modFile' and put then into the cache.
    */
   public List<Modification> getPathModifications(ModificationFile modFile, PartialPath path) {
+    // if the mods file does not exist, do not add it to the cache
+    if (!modFile.exists()) {
+      return Collections.emptyList();
+    }
     Map<String, List<Modification>> fileModifications =
         filePathModCache.computeIfAbsent(modFile.getFilePath(), k -> new ConcurrentHashMap<>());
     return fileModifications.computeIfAbsent(