github-actions[bot] commented on code in PR #33331:
URL: https://github.com/apache/doris/pull/33331#discussion_r1566996701
##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -1612,4 +1616,59 @@ void
FragmentMgr::get_runtime_query_info(std::vector<WorkloadQueryInfo>* query_i
}
}
+Status FragmentMgr::get_realtime_exec_status(const TUniqueId& query_id,
+ TReportExecStatusParams*
exec_status) {
+ if (exec_status == nullptr) {
+ return Status::InvalidArgument("exes_status is nullptr");
+ }
+
+ std::shared_ptr<QueryContext> query_context = nullptr;
+
+ {
+ std::lock_guard<std::mutex> lock(_lock);
+ query_context = _query_ctx_map[query_id];
+ }
+
+ if (query_context == nullptr) {
+ return Status::NotFound("Query {} not found", print_id(query_id));
+ }
+
+ if (query_context->enable_pipeline_x_exec()) {
+ *exec_status = query_context->get_realtime_exec_status_x();
Review Comment:
warning: method 'get_runtime_query_info' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static void
FragmentMgr::get_runtime_query_info(std::vector<WorkloadQueryInfo>*
query_info_list) {
```
##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -1612,4 +1616,59 @@
}
}
+Status FragmentMgr::get_realtime_exec_status(const TUniqueId& query_id,
+ TReportExecStatusParams*
exec_status) {
+ if (exec_status == nullptr) {
+ return Status::InvalidArgument("exes_status is nullptr");
+ }
+
+ std::shared_ptr<QueryContext> query_context = nullptr;
+
+ {
+ std::lock_guard<std::mutex> lock(_lock);
+ query_context = _query_ctx_map[query_id];
+ }
+
+ if (query_context == nullptr) {
+ return Status::NotFound("Query {} not found", print_id(query_id));
+ }
+
+ if (query_context->enable_pipeline_x_exec()) {
+ *exec_status = query_context->get_realtime_exec_status_x();
+ } else {
+ auto instance_ids = query_context->get_fragment_instance_ids();
+ std::unordered_map<TUniqueId, std::shared_ptr<TRuntimeProfileTree>>
instance_profiles;
+ std::vector<std::shared_ptr<TRuntimeProfileTree>>
load_channel_profiles;
+
+ for (auto& instance_id : instance_ids) {
+ std::shared_ptr<PlanFragmentExecutor> instance_executor = nullptr;
+
+ {
+ std::lock_guard<std::mutex> lock(_lock);
+ instance_executor = _fragment_instance_map[instance_id];
+ }
Review Comment:
warning: method 'get_realtime_exec_status' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status FragmentMgr::get_realtime_exec_status(const TUniqueId&
query_id,
```
--
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]