You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2024/10/29 07:24:12 UTC
(iotdb) 04/04: change cache method
This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a commit to branch last_cache
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit dfb11e131a7d8e1e2b140474e75128f84004ee77
Author: Beyyes <cg...@foxmail.com>
AuthorDate: Tue Oct 29 15:23:52 2024 +0800
change cache method
---
.../db/queryengine/execution/fragment/DataNodeQueryContext.java | 4 ++--
.../iotdb/db/queryengine/plan/planner/OperatorTreeGenerator.java | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/DataNodeQueryContext.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/DataNodeQueryContext.java
index 881ff9dc8a2..eddefd9b701 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/DataNodeQueryContext.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/DataNodeQueryContext.java
@@ -47,8 +47,8 @@ public class DataNodeQueryContext {
this.dataNodeFINum = new AtomicInteger(dataNodeFINum);
}
- public boolean unCached(PartialPath path) {
- return uncachedPathToSeriesScanInfo.containsKey(path);
+ public boolean hasCached(PartialPath path) {
+ return !uncachedPathToSeriesScanInfo.containsKey(path);
}
public void addUnCachePath(PartialPath path, AtomicInteger dataNodeSeriesScanNum) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/OperatorTreeGenerator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/OperatorTreeGenerator.java
index 3f70b46398c..329d040f5b7 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/OperatorTreeGenerator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/OperatorTreeGenerator.java
@@ -2819,7 +2819,7 @@ public class OperatorTreeGenerator extends PlanVisitor<Operator, LocalExecutionP
TimeValuePair timeValuePair = null;
context.dataNodeQueryContext.lock();
try {
- if (!context.dataNodeQueryContext.unCached(seriesPath)) {
+ if (context.dataNodeQueryContext.hasCached(seriesPath)) {
timeValuePair = DATA_NODE_SCHEMA_CACHE.getLastCache(seriesPath);
if (timeValuePair == null) {
context.dataNodeQueryContext.addUnCachePath(seriesPath, node.getDataNodeSeriesScanNum());
@@ -3053,9 +3053,9 @@ public class OperatorTreeGenerator extends PlanVisitor<Operator, LocalExecutionP
final MeasurementPath measurementPath =
devicePath.concatAsMeasurementPath(measurementList.get(i));
TimeValuePair timeValuePair = null;
+ context.dataNodeQueryContext.lock();
try {
- context.dataNodeQueryContext.lock();
- if (!context.dataNodeQueryContext.unCached(measurementPath)) {
+ if (context.dataNodeQueryContext.hasCached(measurementPath)) {
timeValuePair = DATA_NODE_SCHEMA_CACHE.getLastCache(measurementPath);
if (timeValuePair == null) {
context.dataNodeQueryContext.addUnCachePath(