![]() |
MySQL 8.0.33
Source Code Documentation
|
Class that represents an abstraction of the Resource Group. More...
#include <resource_group.h>
Public Member Functions | |
Resource_group (const std::string &name, const Type type, bool enabled) | |
Construct a Resource_group object. More... | |
const std::string & | name () const |
Type | type () const |
bool | enabled () const |
void | set_type (Type type) |
void | set_enabled (bool enabled) |
bool | is_defunct () const |
Method to check if resource group is defunct. More... | |
void | set_defunct () |
Method to mark resource group defunct. More... | |
Thread_resource_control * | controller () |
const Thread_resource_control * | controller () const |
bool | is_bound_to_threads () |
Check if resource group is associated with threads. More... | |
bool | is_pfs_thread_id_exists (const ulonglong pfs_thread_id) |
Is pfs thread id already exists in the set. More... | |
void | add_pfs_thread_id (const ulonglong pfs_thread_id) |
Add thread_id to the thread id set associated with this resource group. More... | |
void | remove_pfs_thread_id (const ulonglong pfs_thread_id) |
Remove the PFS thread id. More... | |
void | clear () |
Clear the thread id set associated with this resource group. More... | |
void | apply_control_func (std::function< void(ulonglong)> control_func) |
Apply a control function on threads associated with this resource group. More... | |
std::atomic< ulonglong > & | reference_count () |
uint & | version () |
~Resource_group ()=default | |
Private Member Functions | |
Resource_group (const Resource_group &)=delete | |
Disable copy construction and assignment. More... | |
void | operator= (const Resource_group &)=delete |
Private Attributes | |
std::string | m_name |
Name of the resource group. More... | |
Type | m_type |
Type whether it is user or system resource group. More... | |
bool | m_enabled |
bool flag whether resource is enabled or disabled. More... | |
bool | m_defunct {false} |
Whether resource group is defunct or operative. More... | |
Thread_resource_control | m_thread_resource_control |
Thread resource controller object. More... | |
std::set< ulonglong > | m_pfs_thread_id_set |
Threads associated with this resource group. More... | |
std::mutex | m_set_mutex |
Mutex protecting the resource group set. More... | |
std::atomic< ulonglong > | m_reference_count {0} |
Count of threads referencing resource group. More... | |
uint | m_version {0} |
Version number of a Resource group in-memory instance. More... | |
Class that represents an abstraction of the Resource Group.
It has generic attributes of Resource group name, type, active or inactive, a pointer to a Resource control object.
|
inline |
Construct a Resource_group object.
name | name of the Resource_group. |
type | type of the Resource_group. |
enabled | Check if Resource_group is enabled or not. |
|
default |
|
privatedelete |
Disable copy construction and assignment.
|
inline |
Add thread_id to the thread id set associated with this resource group.
pfs_thread_id | PFS thread id. |
|
inline |
Apply a control function on threads associated with this resource group.
control_func | pointer to Control function. |
|
inline |
Clear the thread id set associated with this resource group.
|
inline |
|
inline |
|
inline |
|
inline |
Check if resource group is associated with threads.
|
inline |
Method to check if resource group is defunct.
|
inline |
Is pfs thread id already exists in the set.
pfs_thread_id | PFS thread id. |
|
inline |
|
privatedelete |
|
inline |
|
inline |
Remove the PFS thread id.
pfs_thread_id | Remove pfs thread id. |
|
inline |
Method to mark resource group defunct.
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Whether resource group is defunct or operative.
|
private |
bool flag whether resource is enabled or disabled.
|
private |
Name of the resource group.
|
private |
Threads associated with this resource group.
|
private |
Count of threads referencing resource group.
Count includes threads associated with this resource group (i.e. threads in m_pfs_thread_id_set) and other threads referencing this resource group (Only system threads internally switched to refer user resource group to execute user queries in some cases. User resource group maintains counter of even such references.)
|
private |
Mutex protecting the resource group set.
|
private |
Thread resource controller object.
|
private |
Type whether it is user or system resource group.
|
private |
Version number of a Resource group in-memory instance.
Version number is incremented on thread resource controls alter. If other threads (only system threads internally switched to refer user resource group to execute user queries for now) references this resource group, then resource group is re-applied by threads on version number mismatch.