qiaojialin commented on a change in pull request #1356:
URL: https://github.com/apache/incubator-iotdb/pull/1356#discussion_r439698953



##########
File path: 
server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkMetadataCache.java
##########
@@ -20,6 +20,7 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;

Review comment:
       fixed

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/cache/ChunkCache.java
##########
@@ -93,40 +93,33 @@ public Chunk get(ChunkMetadata chunkMetaData, 
TsFileSequenceReader reader) throw
 
     try {
       lock.readLock().lock();
-      if (lruCache.containsKey(chunkMetaData)) {
+      Chunk chunk = lruCache.get(chunkMetaData);
+      if (chunk != null) {
         cacheHitNum.incrementAndGet();
         printCacheLog(true);
-        Chunk chunk = lruCache.get(chunkMetaData);
         return new Chunk(chunk.getHeader(), chunk.getData().duplicate(), 
chunk.getDeletedAt());
       }
     } finally {
       lock.readLock().unlock();
     }
 
-    Lock cacheLock = lock.writeLock();

Review comment:
       fixed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to