This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rel/0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/0.13 by this push:
new 0c7d8770d1 [To rel/0.13][IOTDB-4225] Fix QueryContext occupy too much
memory
0c7d8770d1 is described below
commit 0c7d8770d131c3a9850d452bba106aaa3b264120
Author: Liu Xuxin <[email protected]>
AuthorDate: Thu Aug 25 08:44:32 2022 +0800
[To rel/0.13][IOTDB-4225] Fix QueryContext occupy too much memory
---
.../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(