-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature](executor) support Workload Move Action in BE #28918
Conversation
run buildall |
19d0ebb
to
a0113f1
Compare
a0113f1
to
e06c2e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
|
||
#pragma once | ||
|
||
#include <glog/logging.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'glog/logging.h' file not found [clang-diagnostic-error]
#include <glog/logging.h>
^
namespace doris { | ||
class WorkloadMoveActionListener : public TopicListener { | ||
public: | ||
~WorkloadMoveActionListener() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use '= default' to define a trivial destructor [modernize-use-equals-default]
~WorkloadMoveActionListener() {} | |
~WorkloadMoveActionListener() = default; |
@@ -93,6 +93,10 @@ class TaskScheduler { | |||
|
|||
TaskQueue* task_queue() const { return _task_queue.get(); } | |||
|
|||
void set_wg_id(uint64_t wg_id) { this->_wg_id = wg_id; } | |||
|
|||
uint64_t get_wg_id() { return _wg_id; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'get_wg_id' can be made const [readability-make-member-function-const]
uint64_t get_wg_id() { return _wg_id; } | |
uint64_t get_wg_id() const { return _wg_id; } |
@@ -153,6 +153,15 @@ class FragmentMgr : public RestMonitorIface { | |||
|
|||
std::string dump_pipeline_tasks(); | |||
|
|||
void get_query_ctx_by_query_id(TUniqueId query_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'get_query_ctx_by_query_id' can be made static [readability-convert-member-functions-to-static]
void get_query_ctx_by_query_id(TUniqueId query_id, | |
static void get_query_ctx_by_query_id(TUniqueId query_id, |
_task_group = tg; | ||
} | ||
|
||
taskgroup::TaskGroup* get_task_group() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'get_task_group' can be made static [readability-convert-member-functions-to-static]
taskgroup::TaskGroup* get_task_group() { | |
static taskgroup::TaskGroup* get_task_group() { |
} | ||
|
||
vectorized::SimplifiedScanScheduler* get_scan_scheduler() { return _scan_task_scheduler; } | ||
vectorized::SimplifiedScanScheduler* get_scan_scheduler() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'get_scan_scheduler' can be made static [readability-convert-member-functions-to-static]
vectorized::SimplifiedScanScheduler* get_scan_scheduler() { | |
static vectorized::SimplifiedScanScheduler* get_scan_scheduler() { |
@@ -237,6 +238,21 @@ void TaskGroupManager::delete_task_group_by_ids(std::set<uint64_t> used_wg_id) { | |||
LOG(INFO) << "finish clear unused cgroup path"; | |||
} | |||
|
|||
bool TaskGroupManager::migrate_memory_tracker_to_group( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'migrate_memory_tracker_to_group' can be made static [readability-convert-member-functions-to-static]
be/src/runtime/task_group/task_group_manager.h:81:
- bool migrate_memory_tracker_to_group(std::shared_ptr<MemTrackerLimiter> mem_tracker,
+ static bool migrate_memory_tracker_to_group(std::shared_ptr<MemTrackerLimiter> mem_tracker,
std::lock_guard<std::shared_mutex> write_lock(_group_mutex); | ||
if (_task_groups.find(src_group_id) == _task_groups.end() || | ||
_task_groups.find(dst_group_id) == _task_groups.end()) { | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
be/src/runtime/task_group/task_group_manager.cpp:244:
- if (_task_groups.find(src_group_id) == _task_groups.end() ||
- _task_groups.find(dst_group_id) == _task_groups.end()) {
- return false;
- }
- _task_groups[src_group_id]->remove_mem_tracker_limiter(mem_tracker);
- *dst_group_ptr = _task_groups[dst_group_id];
- (*dst_group_ptr)->add_mem_tracker_limiter(mem_tracker);
-
- return true;
+ return !_task_groups.find(src_group_id) == _task_groups.end() ||
+ _task_groups.find(dst_group_id) == _task_groups.end();
|
||
return true; | ||
} | ||
|
||
void TaskGroupManager::stop() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'reset_query_ctx_scan_scheduler' can be made static [readability-convert-member-functions-to-static]
be/src/runtime/task_group/task_group_manager.h:85:
- void reset_query_ctx_scan_scheduler(QueryContext* query_ctx, uint64_t dst_group_id);
+ static void reset_query_ctx_scan_scheduler(QueryContext* query_ctx, uint64_t dst_group_id);
@@ -71,15 +71,27 @@ class TaskGroupManager { | |||
// doris task group only support cpu soft limit | |||
bool enable_cgroup() { return enable_cpu_hard_limit() || config::enable_cgroup_cpu_soft_limit; } | |||
|
|||
pipeline::TaskQueue* get_task_queue_by_id(uint64_t group_id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'get_task_queue_by_id' can be made static [readability-convert-member-functions-to-static]
pipeline::TaskQueue* get_task_queue_by_id(uint64_t group_id) { | |
static pipeline::TaskQueue* get_task_queue_by_id(uint64_t group_id) { |
TeamCity be ut coverage result: |
run buildall |
TeamCity be ut coverage result: |
Proposed changes
support Workload Move Action in BE