github-actions[bot] commented on code in PR #32641:
URL: https://github.com/apache/doris/pull/32641#discussion_r1533875471
##########
be/src/pipeline/exec/partitioned_hash_join_sink_operator.cpp:
##########
@@ -48,15 +48,25 @@ Status
PartitionedHashJoinSinkLocalState::open(RuntimeState* state) {
RETURN_IF_ERROR(PipelineXSinkLocalState::open(state));
return _partitioner->open(state);
}
+Status PartitionedHashJoinSinkLocalState::close(RuntimeState* state, Status
exec_status) {
Review Comment:
warning: method 'close' can be made static
[readability-convert-member-functions-to-static]
be/src/pipeline/exec/partitioned_hash_join_sink_operator.h:48:
```diff
- Status close(RuntimeState* state, Status exec_status) override;
+ static Status close(RuntimeState* state, Status exec_status) override;
```
##########
be/src/runtime/workload_group/workload_group.h:
##########
@@ -82,6 +82,24 @@ class WorkloadGroup : public
std::enable_shared_from_this<WorkloadGroup> {
int64_t memory_used();
+ double spill_threshold_low_water_mark() const { return
_spill_threshold_low_water_mark; }
+ double spill_threashold_high_water_mark() const { return
_spill_threashold_high_water_mark; }
+
+ void set_weighted_memory_used(int64_t tg_total_mem_used, double ratio);
+
+ std::unordered_set<std::shared_ptr<MemTrackerLimiter>>
get_all_mem_trackers();
+
+ int64_t get_weighted_memory_used() {
+ return _weighted_mem_used.load(std::memory_order_relaxed);
+ }
+
+ void check_mem_used(bool& is_low_wartermark, bool& is_high_wartermark) {
Review Comment:
warning: method 'check_mem_used' can be made const
[readability-make-member-function-const]
```suggestion
void check_mem_used(bool& is_low_wartermark, bool& is_high_wartermark)
const {
```
##########
be/src/runtime/workload_group/workload_group_manager.cpp:
##########
@@ -135,6 +137,121 @@
<< "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_used_memory() {
Review Comment:
warning: function 'refresh_wg_used_memory' exceeds recommended
size/complexity thresholds [readability-function-size]
```cpp
void WorkloadGroupMgr::refresh_wg_used_memory() {
^
```
<details>
<summary>Additional context</summary>
**be/src/runtime/workload_group/workload_group_manager.cpp:146:** 106 lines
including whitespace and comments (threshold 80)
```cpp
void WorkloadGroupMgr::refresh_wg_used_memory() {
^
```
</details>
##########
be/src/runtime/memory/mem_tracker_limiter.h:
##########
@@ -244,6 +245,20 @@ class MemTrackerLimiter final : public MemTracker {
// Log the memory usage when memory limit is exceeded.
std::string tracker_limit_exceeded_str();
+ void set_weighted_mem(int64_t weighted_limit, double ratio) {
+ std::lock_guard<std::mutex> l(_weighted_mem_lock);
+ _weighted_consumption = _consumption->current_value() * ratio;
+ _weighted_limit = weighted_limit;
+ }
+ void get_weighted_mem_info(int64_t& weighted_limit, int64_t&
weighted_consumption) {
Review Comment:
warning: method 'get_weighted_mem_info' can be made const
[readability-make-member-function-const]
```suggestion
void get_weighted_mem_info(int64_t& weighted_limit, int64_t&
weighted_consumption) const {
```
##########
be/src/runtime/workload_group/workload_group_manager.cpp:
##########
@@ -135,6 +137,121 @@ 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_used_memory() {
Review Comment:
warning: method 'refresh_wg_used_memory' can be made static
[readability-convert-member-functions-to-static]
be/src/runtime/workload_group/workload_group_manager.h:56:
```diff
- void refresh_wg_used_memory();
+ static void refresh_wg_used_memory();
```
--
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]