kaka11chen commented on code in PR #59307:
URL: https://github.com/apache/doris/pull/59307#discussion_r2707968085
##########
be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp:
##########
@@ -305,6 +495,32 @@ void ColumnChunkReader<IN_COLLECTION,
OFFSET_INDEX>::_reserve_decompress_buf(siz
}
}
+template <bool IN_COLLECTION, bool OFFSET_INDEX>
+void ColumnChunkReader<IN_COLLECTION, OFFSET_INDEX>::_insert_page_into_cache(
+ const std::vector<uint8_t>& level_bytes, const Slice& payload) {
+ StoragePageCache::CacheKey key(
+ fmt::format("{}::{}", _stream_reader->path(),
_stream_reader->mtime()),
+ _page_reader->file_end_offset(),
_page_reader->header_start_offset());
+ const std::vector<uint8_t>& header_bytes = _page_reader->header_bytes();
+ size_t total = header_bytes.size() + level_bytes.size() + payload.size;
+ auto* page = new DataPage(total, true, segment_v2::DATA_PAGE);
Review Comment:
No leak here: StoragePageCache::insert takes ownership of the DataPage* and
the LRU cache frees it via LRUHandle::free() (which deletes LRUCacheValueBase)
when the entry is evicted or the
last handle is released, so the allocation in
be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp is managed by
the cache (be/src/olap/page_cache.cpp, be/src/olap/
lru_cache.h). Even in the LRU‑K “first insert not cached” path, the
returned handle release will free the value.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]