You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2020/05/11 12:35:30 UTC
[incubator-iotdb] branch TyCacheRAMCalculate created (now b90e239)
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a change to branch TyCacheRAMCalculate
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.
at b90e239 change the way to calculate chunkmetadata cache
This branch includes the following new commits:
new b90e239 change the way to calculate chunkmetadata cache
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.
[incubator-iotdb] 01/01: change the way to calculate chunkmetadata
cache
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch TyCacheRAMCalculate
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit b90e23946fbde4416847fe5a40fe35dd865b12af
Author: JackieTien97 <Ja...@foxmail.com>
AuthorDate: Mon May 11 20:35:03 2020 +0800
change the way to calculate chunkmetadata cache
---
.../org/apache/iotdb/db/engine/cache/ChunkMetadataCache.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkMetadataCache.java b/server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkMetadataCache.java
index 2e8f294..b955f31 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkMetadataCache.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkMetadataCache.java
@@ -74,7 +74,8 @@ public class ChunkMetadataCache {
}
if (count < 10) {
- long currentSize = RamUsageEstimator.sizeOf(value.get(0));
+ long currentSize = RamUsageEstimator.shallowSizeOf(value.get(0)) + RamUsageEstimator
+ .shallowSizeOf(value.get(0).getStatistics());
averageChunkMetadataSize = ((averageChunkMetadataSize * count) + currentSize) / (++count);
IoTDBConfigDynamicAdapter.setChunkMetadataSizeInByte(averageChunkMetadataSize);
return key.getBytes().length + currentSize * value.size();
@@ -82,7 +83,8 @@ public class ChunkMetadataCache {
count++;
return key.getBytes().length + averageChunkMetadataSize * value.size();
} else {
- averageChunkMetadataSize = RamUsageEstimator.sizeOf(value.get(0));
+ averageChunkMetadataSize = RamUsageEstimator.shallowSizeOf(value.get(0)) + RamUsageEstimator
+ .shallowSizeOf(value.get(0).getStatistics());
count = 1;
return key.getBytes().length + averageChunkMetadataSize * value.size();
}
@@ -106,7 +108,8 @@ public class ChunkMetadataCache {
if (bloomFilter != null && !bloomFilter.contains(seriesPath.getFullPath())) {
if (logger.isDebugEnabled()) {
logger.debug(String
- .format("path not found by bloom filter, file is: %s, path is: %s", filePath, seriesPath));
+ .format("path not found by bloom filter, file is: %s, path is: %s", filePath,
+ seriesPath));
}
return new ArrayList<>();
}