23#ifndef RESOURCEGROUPS_RESOURCE_GROUP_H_
24#define RESOURCEGROUPS_RESOURCE_GROUP_H_
Class that represents an abstraction of the Resource Group.
Definition: resource_group.h:44
void clear()
Clear the thread id set associated with this resource group.
Definition: resource_group.h:124
Resource_group(const std::string &name, const Type type, bool enabled)
Construct a Resource_group object.
Definition: resource_group.h:54
std::set< ulonglong > m_pfs_thread_id_set
Threads associated with this resource group.
Definition: resource_group.h:166
const std::string & name() const
Definition: resource_group.h:57
std::mutex m_set_mutex
Mutex protecting the resource group set.
Definition: resource_group.h:171
void apply_control_func(std::function< void(ulonglong)> control_func)
Apply a control function on threads associated with this resource group.
Definition: resource_group.h:135
Thread_resource_control * controller()
Definition: resource_group.h:67
void add_pfs_thread_id(const ulonglong pfs_thread_id)
Add thread_id to the thread id set associated with this resource group.
Definition: resource_group.h:104
void remove_pfs_thread_id(const ulonglong pfs_thread_id)
Remove the PFS thread id.
Definition: resource_group.h:115
bool m_enabled
bool flag whether resource is enabled or disabled.
Definition: resource_group.h:156
Resource_group(const Resource_group &)=delete
Disable copy construction and assignment.
Type type() const
Definition: resource_group.h:59
~Resource_group()=default
Type m_type
Type whether it is user or system resource group.
Definition: resource_group.h:151
std::string m_name
Name of the resource group.
Definition: resource_group.h:146
void operator=(const Resource_group &)=delete
bool is_bound_to_threads()
Check if resource group is associated with threads.
Definition: resource_group.h:80
void set_enabled(bool enabled)
Definition: resource_group.h:65
void set_type(Type type)
Definition: resource_group.h:63
bool is_pfs_thread_id_exists(const ulonglong pfs_thread_id)
Is pfs thread id already exists in the set.
Definition: resource_group.h:93
bool enabled() const
Definition: resource_group.h:61
const Thread_resource_control * controller() const
Definition: resource_group.h:69
Thread_resource_control m_thread_resource_control
Thread resource controller object.
Definition: resource_group.h:161
Class that abstracts the resource control that can be applied to threads.
Definition: thread_resource_control.h:40
Error logging, slow query logging, general query logging: If it's server-internal,...
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Definition: dd_resource_group.h:29
Type
Definition: resource_group_basic_types.h:33
static std::mutex lock
Definition: net_ns.cc:56