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:44
void clear()
Clear the thread id set associated with this resource group.
Definition: resource_group.h:140
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:192
std::atomic< ulonglong > m_reference_count
Count of threads referencing resource group.
Definition: resource_group.h:207
const std::string & name() const
Definition: resource_group.h:57
uint & version()
Definition: resource_group.h:159
std::mutex m_set_mutex
Mutex protecting the resource group set.
Definition: resource_group.h:197
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:152
Thread_resource_control * controller()
Definition: resource_group.h:81
void set_defunct()
Method to mark resource group defunct.
Definition: resource_group.h:79
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:118
void remove_pfs_thread_id(const ulonglong pfs_thread_id)
Remove the PFS thread id.
Definition: resource_group.h:130
bool m_enabled
bool flag whether resource is enabled or disabled.
Definition: resource_group.h:177
Resource_group(const Resource_group &)=delete
Disable copy construction and assignment.
Type type() const
Definition: resource_group.h:59
bool m_defunct
Whether resource group is defunct or operative.
Definition: resource_group.h:182
~Resource_group()=default
Type m_type
Type whether it is user or system resource group.
Definition: resource_group.h:172
bool is_defunct() const
Method to check if resource group is defunct.
Definition: resource_group.h:73
std::string m_name
Name of the resource group.
Definition: resource_group.h:167
void operator=(const Resource_group &)=delete
uint m_version
Version number of a Resource group in-memory instance.
Definition: resource_group.h:216
bool is_bound_to_threads()
Check if resource group is associated with threads.
Definition: resource_group.h:94
void set_enabled(bool enabled)
Definition: resource_group.h:65
void set_type(Type type)
Definition: resource_group.h:63
std::atomic< ulonglong > & reference_count()
Definition: resource_group.h:157
bool is_pfs_thread_id_exists(const ulonglong pfs_thread_id)
Is pfs thread id already exists in the set.
Definition: resource_group.h:107
bool enabled() const
Definition: resource_group.h:61
const Thread_resource_control * controller() const
Definition: resource_group.h:83
Thread_resource_control m_thread_resource_control
Thread resource controller object.
Definition: resource_group.h:187
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
unsigned int uint
Definition: uca-dump.cc:29