22#ifndef RESOURCEGROUPS_RESOURCE_GROUP_H_
23#define RESOURCEGROUPS_RESOURCE_GROUP_H_
Class that represents an abstraction of the Resource Group.
Definition: resource_group.h:43
void clear()
Clear the thread id set associated with this resource group.
Definition: resource_group.h:123
Resource_group(const std::string &name, const Type type, bool enabled)
Construct a Resource_group object.
Definition: resource_group.h:53
std::set< ulonglong > m_pfs_thread_id_set
Threads associated with this resource group.
Definition: resource_group.h:165
const std::string & name() const
Definition: resource_group.h:56
std::mutex m_set_mutex
Mutex protecting the resource group set.
Definition: resource_group.h:170
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:134
Thread_resource_control * controller()
Definition: resource_group.h:66
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:103
void remove_pfs_thread_id(const ulonglong pfs_thread_id)
Remove the PFS thread id.
Definition: resource_group.h:114
bool m_enabled
bool flag whether resource is enabled or disabled.
Definition: resource_group.h:155
Resource_group(const Resource_group &)=delete
Disable copy construction and assignment.
Type type() const
Definition: resource_group.h:58
~Resource_group()=default
Type m_type
Type whether it is user or system resource group.
Definition: resource_group.h:150
std::string m_name
Name of the resource group.
Definition: resource_group.h:145
void operator=(const Resource_group &)=delete
bool is_bound_to_threads()
Check if resource group is associated with threads.
Definition: resource_group.h:79
void set_enabled(bool enabled)
Definition: resource_group.h:64
void set_type(Type type)
Definition: resource_group.h:62
bool is_pfs_thread_id_exists(const ulonglong pfs_thread_id)
Is pfs thread id already exists in the set.
Definition: resource_group.h:92
bool enabled() const
Definition: resource_group.h:60
const Thread_resource_control * controller() const
Definition: resource_group.h:68
Thread_resource_control m_thread_resource_control
Thread resource controller object.
Definition: resource_group.h:160
Class that abstracts the resource control that can be applied to threads.
Definition: thread_resource_control.h:39
Error logging, slow query logging, general query logging: If it's server-internal,...
unsigned long long int ulonglong
Definition: my_inttypes.h:55
Definition: dd_resource_group.h:28
Type
Definition: resource_group_basic_types.h:32
static std::mutex lock
Definition: net_ns.cc:55