You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2022/12/08 02:50:59 UTC
[iotdb] 04/04: fix TimeSeriesMetadataCacheMiss
This is an automated email from the ASF dual-hosted git repository.
hui pushed a commit to branch QueryMetrics
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit a88c3f21034e8e0f8357e8fa56dd54ca6c96898d
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Thu Dec 8 10:50:34 2022 +0800
fix TimeSeriesMetadataCacheMiss
---
.../apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java b/server/src/main/java/org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java
index e30444d761..9abf4f4ce9 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/cache/TimeSeriesMetadataCache.java
@@ -149,11 +149,10 @@ public class TimeSeriesMetadataCache {
// allow for the parallelism of different devices
synchronized (
devices.computeIfAbsent(key.device + SEPARATOR + key.filePath, WeakReference::new)) {
- long startTime = System.nanoTime();
-
// double check
timeseriesMetadata = lruCache.getIfPresent(key);
if (timeseriesMetadata == null) {
+ long startTime = System.nanoTime();
Path path = new Path(key.device, key.measurement, true);
// bloom filter part
BloomFilter bloomFilter =
@@ -184,10 +183,10 @@ public class TimeSeriesMetadataCache {
timeseriesMetadata = metadata.getStatistics().getCount() == 0 ? null : metadata;
}
}
- }
- QueryStatistics.getInstance()
- .addCost(TIME_SERIES_METADATA_CACHE_MISS, System.nanoTime() - startTime);
+ QueryStatistics.getInstance()
+ .addCost(TIME_SERIES_METADATA_CACHE_MISS, System.nanoTime() - startTime);
+ }
}
}
if (timeseriesMetadata == null) {