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


##########
be/src/runtime/workload_group/workload_group_manager.cpp:
##########
@@ -135,6 +137,127 @@ void 
WorkloadGroupMgr::delete_workload_group_by_ids(std::set<uint64_t> used_wg_i
               << "ms, deleted group size:" << deleted_task_groups.size();
 }
 
+struct WorkloadGroupMemInfo {
+    int64_t total_mem_used = 0;
+    int64_t weighted_mem_used = 0;
+    bool is_low_wartermark = false;
+    bool is_high_wartermark = false;
+    double mem_used_ratio = 0;
+};
+void WorkloadGroupMgr::refresh_wg_memory_info() {

Review Comment:
   warning: function 'refresh_wg_memory_info' exceeds recommended 
size/complexity thresholds [readability-function-size]
   ```cpp
   void WorkloadGroupMgr::refresh_wg_memory_info() {
                          ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/runtime/workload_group/workload_group_manager.cpp:146:** 112 lines 
including whitespace and comments (threshold 80)
   ```cpp
   void WorkloadGroupMgr::refresh_wg_memory_info() {
                          ^
   ```
   
   </details>
   



##########
be/src/pipeline/pipeline_x/pipeline_x_task.cpp:
##########
@@ -326,6 +304,48 @@ Status PipelineXTask::execute(bool* eos) {
     return status;
 }
 
+bool PipelineXTask::should_revoke_memory(RuntimeState* state, int64_t 
revocable_mem_bytes) {
+    auto* query_ctx = state->get_query_ctx();
+    auto wg = query_ctx->workload_group();
+    if (!wg) {
+        LOG_ONCE(INFO) << "no workload group for query " << 
print_id(state->query_id());
+        return false;
+    }
+    bool is_wg_mem_low_water_mark = false;
+    bool is_wg_mem_high_water_mark = false;
+    wg->check_mem_used(&is_wg_mem_low_water_mark, &is_wg_mem_high_water_mark);
+    if (is_wg_mem_high_water_mark) {
+        if (revocable_mem_bytes > 0) {
+            LOG_EVERY_N(INFO, 5) << "revoke memory, hight water mark";
+            return true;

Review Comment:
   warning: redundant boolean literal in conditional return statement 
[readability-simplify-boolean-expr]
   
   be/src/pipeline/pipeline_x/pipeline_x_task.cpp:317:
   ```diff
   -         if (revocable_mem_bytes > 0) {
   -             LOG_EVERY_N(INFO, 5) << "revoke memory, hight water mark";
   -             return true;
   -         }
   -         return false;
   +         return revocable_mem_bytes > 0;
   ```
   



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