yiguolei commented on code in PR #69982:
URL: https://github.com/apache/doris/pull/69982#discussion_r4623102873
##########
be/src/storage/segment/segment.cpp:
##########
@@ -1215,6 +1223,145 @@ Status Segment::read_key_by_rowid(uint32_t row_id,
std::string* key) {
return Status::OK();
}
+namespace {
+
+Status init_column_iterator(Segment& segment, const TabletColumn& column,
+ StorageReadOptions& read_options,
+ std::unique_ptr<ColumnIterator>& iterator,
+ const std::shared_ptr<const
ColumnReadAheadResources>& read_ahead) {
+ DORIS_CHECK(read_options.stats != nullptr);
+ DCHECK(iterator == nullptr);
+ RETURN_IF_ERROR(segment.new_column_iterator(column, &iterator,
&read_options));
+ auto io_ctx = read_options.io_ctx;
+ io_ctx.reader_type = ReaderType::READER_QUERY;
+ io_ctx.file_cache_stats = &read_options.stats->file_cache_stats;
+ ColumnIteratorOptions options {
+ .use_page_cache = !config::disable_storage_page_cache,
+ .file_reader = segment.file_reader().get(),
+ .stats = read_options.stats,
+ .io_ctx = io_ctx,
+ .read_ahead = read_ahead,
+ };
+ RETURN_IF_ERROR(iterator->init(options));
+ return Status::OK();
+}
+
+} // namespace
+
+Status Segment::read_columns_by_rowids(
Review Comment:
不论segment iterator 还是segment 感觉不应该让外部传递read context 这种概念。因为我们已经有一堆options,
已经能够判断是否需要read ahead
--
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]