You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/04/14 07:46:34 UTC
[incubator-iotdb] branch rename_metadata_querier created (now
7dcd88e)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a change to branch rename_metadata_querier
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.
at 7dcd88e add comment for MetadataQuerierByFileImpl
This branch includes the following new commits:
new 7dcd88e add comment for MetadataQuerierByFileImpl
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: add comment for MetadataQuerierByFileImpl
Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch rename_metadata_querier
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit 7dcd88e8a040676746ce33867595af12ffe0714a
Author: qiaojialin <64...@qq.com>
AuthorDate: Tue Apr 14 15:44:43 2020 +0800
add comment for MetadataQuerierByFileImpl
---
.../iotdb/tsfile/read/controller/MetadataQuerierByFileImpl.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/controller/MetadataQuerierByFileImpl.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/controller/MetadataQuerierByFileImpl.java
index 74714fa..aa86346 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/controller/MetadataQuerierByFileImpl.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/controller/MetadataQuerierByFileImpl.java
@@ -33,7 +33,8 @@ import java.util.*;
public class MetadataQuerierByFileImpl implements IMetadataQuerier {
- private static final int CHUNK_METADATA_CACHE_SIZE = 10000;
+ // number of cache entries (path -> List<ChunkMetadata>)
+ private static final int CACHED_ENTRY_NUMBER = 1000;
private TsFileMetadata fileMetaData;
@@ -47,7 +48,7 @@ public class MetadataQuerierByFileImpl implements IMetadataQuerier {
public MetadataQuerierByFileImpl(TsFileSequenceReader tsFileReader) throws IOException {
this.tsFileReader = tsFileReader;
this.fileMetaData = tsFileReader.readFileMetadata();
- chunkMetaDataCache = new LRUCache<Path, List<ChunkMetadata>>(CHUNK_METADATA_CACHE_SIZE) {
+ chunkMetaDataCache = new LRUCache<Path, List<ChunkMetadata>>(CACHED_ENTRY_NUMBER) {
@Override
public List<ChunkMetadata> loadObjectByKey(Path key) throws IOException {
return loadChunkMetadata(key);
@@ -131,7 +132,7 @@ public class MetadataQuerierByFileImpl implements IMetadataQuerier {
// check cache size, stop when reading enough
count++;
- if (count == CHUNK_METADATA_CACHE_SIZE) {
+ if (count == CACHED_ENTRY_NUMBER) {
enough = true;
break;
}