Skip to content

Commit

Permalink
fix cached time chunk flip twice
Browse files Browse the repository at this point in the history
  • Loading branch information
shuwenwei committed Oct 24, 2024
1 parent 4e79200 commit 58302c9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ public Chunk getTimeChunkFromCache(TsFileSequenceReader reader, ChunkMetadata ch
if (chunk == null) {
chunk = reader.readMemChunk(chunkMetadata);
}
chunk.getData().flip();
chunk.getData().reset();
return chunk;
}

public void addTimeChunkToCache(String file, long offset, Chunk chunk) {
if (cachedTimeChunkSize >= MAX_CACHED_TIME_CHUNKS_SIZE) {
return;
}
chunk.getData().mark();
cachedTimeChunks.put(
new Pair<>(file, offset),
new Chunk(
Expand Down

0 comments on commit 58302c9

Please sign in to comment.