freemandealer commented on code in PR #48786:
URL: https://github.com/apache/doris/pull/48786#discussion_r1984785185
##########
be/src/olap/rowset/segment_v2/segment.cpp:
##########
@@ -520,21 +511,20 @@ Status Segment::load_index(OlapReaderStatistics* stats) {
// read and parse short key index page
OlapReaderStatistics tmp_stats;
OlapReaderStatistics* stats_ptr = stats != nullptr ? stats :
&tmp_stats;
- PageReadOptions opts {
- .use_page_cache = true,
- .type = INDEX_PAGE,
- .file_reader = _file_reader.get(),
- .page_pointer = PagePointer(_sk_index_page),
- // short key index page uses NO_COMPRESSION for now
- .codec = nullptr,
- .stats = &tmp_stats,
- .io_ctx = io::IOContext {.is_index_data = true,
- .file_cache_stats =
&stats_ptr->file_cache_stats},
- };
+ PageReadOptions opts(io::IOContext {.is_index_data = true,
+ .file_cache_stats =
&stats_ptr->file_cache_stats});
+ opts.use_page_cache = true;
+ opts.type = INDEX_PAGE;
+ opts.file_reader = _file_reader.get();
+ opts.page_pointer = PagePointer(_sk_index_page);
+ // short key index page uses NO_COMPRESSION for now
+ opts.codec = nullptr;
+ opts.stats = &tmp_stats;
+
Slice body;
PageFooterPB footer;
- RETURN_IF_ERROR(
- PageIO::read_and_decompress_page(opts, &_sk_index_handle,
&body, &footer));
+
RETURN_IF_ERROR(PageIO::read_and_decompress_page_with_file_cache_retry(
Review Comment:
这个可能做不到,因为 read_and_decompress 用到的地方太多了,除非要多增加一层抽象。另外,Page IO 本身是 read data
from file,引入 file cache 是比较自然的。相反,向更高层次的 segment 暴露反而不好,但是 segment 有一些 open
file 的操作,需要做一些 check 所以也没法避免
--
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]