github-actions[bot] commented on code in PR #43623:
URL: https://github.com/apache/doris/pull/43623#discussion_r1836266611


##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -1890,5 +1888,189 @@
     
_runtime_state->load_channel_profile()->to_thrift(load_channel_profile.get());
     return load_channel_profile;
 }
+
+StatusReporter::StatusReporter(const BaseReportStatusRequest&& request)
+        : _context(request.context),
+          _thread_pool(request.global_thread_pool),
+          _exec_env(request.exec_env) {
+    _params.protocol_version = FrontendServiceVersion::V1;
+    _params.__set_query_id(request.query_id);
+    _params.__set_backend_num(-1);
+    _params.__set_fragment_instance_id(TUniqueId());
+    _params.__set_fragment_id(request.fragment_id);
+    _params.__isset.profile = false;
+    if (_exec_env->master_info()->__isset.backend_id) {
+        _params.__set_backend_id(_exec_env->master_info()->backend_id);
+    }
+}
+
+Status StatusReporter::report(const ReportStatusRequest& request) {
+    return _thread_pool->submit_func([this, request]() {
+        SCOPED_ATTACH_TASK(_context->get_query_ctx()->query_mem_tracker);
+        _do_report(request);
+        if (!request.done) {
+            _context->refresh_next_report_time();
+        }
+    });
+}
+
+// There can only be one of these callbacks in-flight at any moment, because
+// it is only invoked from the executor's reporting thread.
+// Also, the reported status will always reflect the most recent execution 
status,
+// including the final status when execution finishes.
+void StatusReporter::_do_report(const ReportStatusRequest& req) {

Review Comment:
   warning: function '_do_report' exceeds recommended size/complexity 
thresholds [readability-function-size]
   ```cpp
   void StatusReporter::_do_report(const ReportStatusRequest& req) {
                        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/pipeline_fragment_context.cpp:1920:** 153 lines including 
whitespace and comments (threshold 80)
   ```cpp
   void StatusReporter::_do_report(const ReportStatusRequest& req) {
                        ^
   ```
   
   </details>
   



##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -227,8 +235,7 @@ PipelinePtr 
PipelineFragmentContext::add_pipeline(PipelinePtr parent, int idx) {
     return pipeline;
 }
 
-Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& 
request,
-                                        ThreadPool* thread_pool) {
+Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& 
request) {

Review Comment:
   warning: function 'prepare' exceeds recommended size/complexity thresholds 
[readability-function-size]
   ```cpp
   Status PipelineFragmentContext::prepare(const 
doris::TPipelineFragmentParams& request) {
                                   ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/pipeline_fragment_context.cpp:237:** 122 lines including 
whitespace and comments (threshold 80)
   ```cpp
   Status PipelineFragmentContext::prepare(const 
doris::TPipelineFragmentParams& request) {
                                   ^
   ```
   
   </details>
   



##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -350,8 +359,8 @@
     return Status::OK();
 }
 
-Status PipelineFragmentContext::_build_pipeline_tasks(const 
doris::TPipelineFragmentParams& request,
-                                                      ThreadPool* thread_pool) 
{
+Status PipelineFragmentContext::_build_pipeline_tasks(

Review Comment:
   warning: function '_build_pipeline_tasks' exceeds recommended 
size/complexity thresholds [readability-function-size]
   ```cpp
   Status PipelineFragmentContext::_build_pipeline_tasks(
                                   ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/pipeline_fragment_context.cpp:361:** 211 lines including 
whitespace and comments (threshold 80)
   ```cpp
   Status PipelineFragmentContext::_build_pipeline_tasks(
                                   ^
   ```
   
   </details>
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to