MySQL 8.0.39
Source Code Documentation
resourcegroups::Resource_group Class Reference

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)
 
Thread_resource_controlcontroller ()
 
const Thread_resource_controlcontroller () 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...
 
 ~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...
 
Thread_resource_control m_thread_resource_control
 Thread resource controller object. More...
 
std::set< ulonglongm_pfs_thread_id_set
 Threads associated with this resource group. More...
 
std::mutex m_set_mutex
 Mutex protecting the resource group set. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Resource_group() [1/2]

resourcegroups::Resource_group::Resource_group ( const std::string &  name,
const Type  type,
bool  enabled 
)
inline

Construct a Resource_group object.

Parameters
namename of the Resource_group.
typetype of the Resource_group.
enabledCheck if Resource_group is enabled or not.

◆ ~Resource_group()

resourcegroups::Resource_group::~Resource_group ( )
default

◆ Resource_group() [2/2]

resourcegroups::Resource_group::Resource_group ( const Resource_group )
privatedelete

Disable copy construction and assignment.

Member Function Documentation

◆ add_pfs_thread_id()

void resourcegroups::Resource_group::add_pfs_thread_id ( const ulonglong  pfs_thread_id)
inline

Add thread_id to the thread id set associated with this resource group.

Parameters
pfs_thread_idPFS thread id.

◆ apply_control_func()

void resourcegroups::Resource_group::apply_control_func ( std::function< void(ulonglong)>  control_func)
inline

Apply a control function on threads associated with this resource group.

Parameters
control_funcpointer to Control function.

◆ clear()

void resourcegroups::Resource_group::clear ( )
inline

Clear the thread id set associated with this resource group.

◆ controller() [1/2]

Thread_resource_control * resourcegroups::Resource_group::controller ( )
inline

◆ controller() [2/2]

const Thread_resource_control * resourcegroups::Resource_group::controller ( ) const
inline

◆ enabled()

bool resourcegroups::Resource_group::enabled ( ) const
inline

◆ is_bound_to_threads()

bool resourcegroups::Resource_group::is_bound_to_threads ( )
inline

Check if resource group is associated with threads.

Returns
true if some threads are mapped with this resource group else false.

◆ is_pfs_thread_id_exists()

bool resourcegroups::Resource_group::is_pfs_thread_id_exists ( const ulonglong  pfs_thread_id)
inline

Is pfs thread id already exists in the set.

Parameters
pfs_thread_idPFS thread id.
Returns
true if thread id exists in the set else false.

◆ name()

const std::string & resourcegroups::Resource_group::name ( ) const
inline

◆ operator=()

void resourcegroups::Resource_group::operator= ( const Resource_group )
privatedelete

◆ remove_pfs_thread_id()

void resourcegroups::Resource_group::remove_pfs_thread_id ( const ulonglong  pfs_thread_id)
inline

Remove the PFS thread id.

Parameters
pfs_thread_idRemove pfs thread id.

◆ set_enabled()

void resourcegroups::Resource_group::set_enabled ( bool  enabled)
inline

◆ set_type()

void resourcegroups::Resource_group::set_type ( Type  type)
inline

◆ type()

Type resourcegroups::Resource_group::type ( ) const
inline

Member Data Documentation

◆ m_enabled

bool resourcegroups::Resource_group::m_enabled
private

bool flag whether resource is enabled or disabled.

◆ m_name

std::string resourcegroups::Resource_group::m_name
private

Name of the resource group.

◆ m_pfs_thread_id_set

std::set<ulonglong> resourcegroups::Resource_group::m_pfs_thread_id_set
private

Threads associated with this resource group.

◆ m_set_mutex

std::mutex resourcegroups::Resource_group::m_set_mutex
private

Mutex protecting the resource group set.

◆ m_thread_resource_control

Thread_resource_control resourcegroups::Resource_group::m_thread_resource_control
private

Thread resource controller object.

◆ m_type

Type resourcegroups::Resource_group::m_type
private

Type whether it is user or system resource group.


The documentation for this class was generated from the following file: