yiguolei commented on code in PR #60567:
URL: https://github.com/apache/doris/pull/60567#discussion_r3123609506
##########
be/src/runtime/query_context.cpp:
##########
@@ -558,4 +558,29 @@ Status QueryContext::reset_global_rf(const
google::protobuf::RepeatedField<int32
return Status::OK();
}
+void QueryContext::get_task_counts(int* total, int* finished) {
+ *total = 0;
+ *finished = 0;
+ {
+ // Load counts from already closed and cleaned-up fragments (archived
in QueryContext)
+ std::lock_guard<std::mutex> lock(_task_counts_lock);
+ *total = _finished_task_counts.total;
+ *finished = _finished_task_counts.finished;
+ }
+ // Add counts from currently active fragments
+ std::lock_guard<std::mutex> lock(_pipeline_map_write_lock);
Review Comment:
感觉这个不是很合理。
1. 在pipeline fragment context 初始化的时候,是知道自己有多少个task的,此时可以累加到query context 中。
2. 每个task 结束的时候,也可以实时的更新query context 中的finish task的数量
--
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]