[feature-wip](resouce-group) Supports memory soft isolation of resource group (#19802)
create resource groups name properties(
'enable_memory_overcommit' = 'true' // whether to enable memory soft isolation
)
This commit is contained in:
@ -54,20 +54,14 @@ TaskGroupPtr TaskGroupManager::get_or_create_task_group(const TaskGroupInfo& tas
|
||||
return new_task_group;
|
||||
}
|
||||
|
||||
int64_t TaskGroupManager::memory_limit_gc() {
|
||||
int64_t total_free_memory = 0;
|
||||
std::vector<TaskGroupPtr> task_groups;
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> r_lock(_group_mutex);
|
||||
task_groups.reserve(_task_groups.size());
|
||||
for (const auto& [id, task_group] : _task_groups) {
|
||||
task_groups.push_back(task_group);
|
||||
void TaskGroupManager::get_resource_groups(const std::function<bool(const TaskGroupPtr& ptr)>& pred,
|
||||
std::vector<TaskGroupPtr>* task_groups) {
|
||||
std::shared_lock<std::shared_mutex> r_lock(_group_mutex);
|
||||
for (const auto& [id, task_group] : _task_groups) {
|
||||
if (pred(task_group)) {
|
||||
task_groups->push_back(task_group);
|
||||
}
|
||||
}
|
||||
for (const auto& task_group : task_groups) {
|
||||
total_free_memory += task_group->memory_limit_gc();
|
||||
}
|
||||
return total_free_memory;
|
||||
}
|
||||
|
||||
} // namespace doris::taskgroup
|
||||
|
||||
Reference in New Issue
Block a user