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/24 11:40:36 UTC

[iotdb] branch IOTDB-4255-0.13 created (now 6389a0a1ce)

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

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


      at 6389a0a1ce Do not add modification to cache when mod file does not exist

This branch includes the following new commits:

     new 6389a0a1ce Do not add modification to cache when mod 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 modification to cache when mod 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-4255-0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 6389a0a1ced0e495af1bbf75d2ecab4ce2718886
Author: Liu Xuxin <li...@outlook.com>
AuthorDate: Wed Aug 24 19:40:16 2022 +0800

    Do not add modification to cache when mod 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 df1b0083d8..c82b7470f3 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 modFile does not exist, do not add it to cache
+    if (!modFile.exists()) {
+      return Collections.emptyList();
+    }
     Map<String, List<Modification>> fileModifications =
         filePathModCache.computeIfAbsent(modFile.getFilePath(), k -> new ConcurrentHashMap<>());
     return fileModifications.computeIfAbsent(