Yuan Tian created IOTDB-192:
-------------------------------
Summary: Improvement for LRUCache.java
Key: IOTDB-192
URL: https://issues.apache.org/jira/browse/IOTDB-192
Project: Apache IoTDB
Issue Type: Improvement
Reporter: Yuan Tian
Attachments: LRUCache.java
# First, I got a question for the default value of
_*CHUNK_METADATA_CACHE_SIZE****_ **in MetadataQuerierByFileImpl* which is
100000, will the number of sensors in one tsfile really reach that?
# Second, if the number can really reach that, why don't we set the
*_initialCapacity_* of *LinkedHashMap* to _*CHUNK_METADATA_CACHE_SIZE*_ to
avoid rehashing.
# Last but not the least, the field *_accessOrder_* and the method
*_removeEldestEntry_* in *LinkedHashMap* provide convenience for us to
implement *LRUCache**. The method _moveObjectToTail_**,
_removeFirstObjectIfCacheIsFull_**, _removeFirstObject_* in *LRUCache.java* are
unnecessary and these methods may also lower the efficiency. So, I simplify the
code of *LRUCache.java* which you can see in the attachment.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)