yiguolei commented on code in PR #69982:
URL: https://github.com/apache/doris/pull/69982#discussion_r4623279816


##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -388,6 +390,30 @@ Status SegmentIterator::init(const StorageReadOptions& 
opts) {
     return status;
 }
 
+Status SegmentIterator::_init_query_read_ahead() {
+    if (!ColumnReadAheadResources::enabled() ||
+        _opts.io_ctx.reader_type != ReaderType::READER_QUERY) {
+        return Status::OK();
+    }
+
+    DORIS_CHECK(_opts.runtime_state != nullptr);
+    auto* exec_env = _opts.runtime_state->exec_env();
+    DORIS_CHECK(exec_env != nullptr);
+    auto* scheduler = exec_env->file_range_read_scheduler();
+    DORIS_CHECK(scheduler != nullptr);
+    auto* query_context = _opts.runtime_state->get_query_ctx();
+    DORIS_CHECK(query_context != nullptr);
+    auto read_context = 
query_context->get_or_create_file_range_read_context(scheduler);

Review Comment:
   我们现在在options 中已经有一个IOContext了,我们不要再引入新的context了。 先去把代码重构一下,让query 级别有一个io 
context,然后把io context 从scan --》 rowset reader ---》 segment iterator 一级级的传递下来



-- 
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]

Reply via email to