MySQL 9.0.0
Source Code Documentation
PFS_variable_cache< Var_type > Class Template Referenceabstract

Base class for a system or status variable cache. More...

#include <pfs_variable.h>

Public Types

typedef Prealloced_array< Var_type, SYSTEM_VARIABLE_PREALLOCVariable_array
 

Public Member Functions

 PFS_variable_cache (bool external_init)
 
virtual ~PFS_variable_cache ()=0
 Destructor. More...
 
bool initialize_session ()
 Build array of SHOW_VARs from the external variable source. More...
 
bool initialize_client_session ()
 Build array of SHOW_VARs suitable for aggregation by user, host or account. More...
 
int materialize_global ()
 Build cache of GLOBAL system or status variables. More...
 
int materialize_all (THD *thd)
 Build cache of GLOBAL and SESSION variables for a non-instrumented thread. More...
 
int materialize_session (THD *thd)
 Build cache of SESSION variables for a non-instrumented thread. More...
 
int materialize_session (PFS_thread *pfs_thread, bool use_mem_root=false)
 Build cache of SESSION variables for an instrumented thread. More...
 
int materialize_session (PFS_thread *pfs_thread, uint index)
 Cache a single SESSION variable for an instrumented thread. More...
 
int materialize_user (PFS_user *pfs_user)
 Build cache of SESSION status variables for a user. More...
 
int materialize_host (PFS_host *pfs_host)
 Build cache of SESSION status variables for a host. More...
 
int materialize_account (PFS_account *pfs_account)
 Build cache of SESSION status variables for an account. More...
 
bool is_materialized ()
 True if variables have been materialized. More...
 
bool is_materialized (THD *unsafe_thd)
 True if variables have been materialized for given THD. More...
 
bool is_materialized (PFS_thread *pfs_thread)
 True if variables have been materialized for given PFS_thread. More...
 
bool is_materialized (PFS_user *pfs_user)
 True if variables have been materialized for given PFS_user. More...
 
bool is_materialized (PFS_host *pfs_host)
 True if variables have been materialized for given PFS_host. More...
 
bool is_materialized (PFS_account *pfs_account)
 True if variables have been materialized for given PFS_account. More...
 
bool is_materialized (PFS_client *pfs_client)
 True if variables have been materialized for given PFS_user/host/account. More...
 
THD_ptr get_THD (THD *thd)
 Get a validated THD from the thread manager. More...
 
THD_ptr get_THD (PFS_thread *pfs_thread)
 
const Var_type * get (uint index=0) const
 Get a single variable from the cache. More...
 
uint size ()
 Number of elements in the cache. More...
 

Protected Attributes

THDm_safe_thd
 
THDm_unsafe_thd
 
THDm_current_thd
 
PFS_threadm_pfs_thread
 
PFS_clientm_pfs_client
 
Find_THD_variable m_thd_finder
 
Variable_array m_cache
 
bool m_initialized
 
bool m_external_init
 
bool m_materialized
 
Show_var_array m_show_var_array
 
System_variable_tracker::Array m_sys_var_tracker_array
 
ulonglong m_version
 
enum_var_type m_query_scope
 
bool m_use_mem_root
 
bool m_aggregate
 

Private Member Functions

virtual bool do_initialize_global ()
 
virtual bool do_initialize_session ()
 
virtual int do_materialize_global ()
 
virtual int do_materialize_all (THD *)
 
virtual int do_materialize_session (THD *)
 
virtual int do_materialize_session (PFS_thread *)
 
virtual int do_materialize_session (PFS_thread *, uint)
 

Detailed Description

template<class Var_type>
class PFS_variable_cache< Var_type >

Base class for a system or status variable cache.

Member Typedef Documentation

◆ Variable_array

template<class Var_type >
typedef Prealloced_array<Var_type, SYSTEM_VARIABLE_PREALLOC> PFS_variable_cache< Var_type >::Variable_array

Constructor & Destructor Documentation

◆ PFS_variable_cache()

template<class Var_type >
PFS_variable_cache< Var_type >::PFS_variable_cache ( bool  external_init)
explicit

◆ ~PFS_variable_cache()

template<class Var_type >
PFS_variable_cache< Var_type >::~PFS_variable_cache ( )
pure virtualdefault

Destructor.

Member Function Documentation

◆ do_initialize_global()

template<class Var_type >
virtual bool PFS_variable_cache< Var_type >::do_initialize_global ( )
inlineprivatevirtual

◆ do_initialize_session()

template<class Var_type >
virtual bool PFS_variable_cache< Var_type >::do_initialize_session ( )
inlineprivatevirtual

◆ do_materialize_all()

template<class Var_type >
virtual int PFS_variable_cache< Var_type >::do_materialize_all ( THD )
inlineprivatevirtual

◆ do_materialize_global()

template<class Var_type >
virtual int PFS_variable_cache< Var_type >::do_materialize_global ( )
inlineprivatevirtual

◆ do_materialize_session() [1/3]

template<class Var_type >
virtual int PFS_variable_cache< Var_type >::do_materialize_session ( PFS_thread )
inlineprivatevirtual

◆ do_materialize_session() [2/3]

template<class Var_type >
virtual int PFS_variable_cache< Var_type >::do_materialize_session ( PFS_thread ,
uint   
)
inlineprivatevirtual

◆ do_materialize_session() [3/3]

template<class Var_type >
virtual int PFS_variable_cache< Var_type >::do_materialize_session ( THD )
inlineprivatevirtual

◆ get()

template<class Var_type >
const Var_type * PFS_variable_cache< Var_type >::get ( uint  index = 0) const
inline

Get a single variable from the cache.

Get the first element in the cache by default.

◆ get_THD() [1/2]

template<class Var_type >
THD_ptr PFS_variable_cache< Var_type >::get_THD ( PFS_thread pfs_thread)

◆ get_THD() [2/2]

template<class Var_type >
THD_ptr PFS_variable_cache< Var_type >::get_THD ( THD unsafe_thd)

Get a validated THD from the thread manager.

Execute callback function while inside of the thread manager locks.

Execute callback function while while inside the thread manager lock.

◆ initialize_client_session()

template<class Var_type >
bool PFS_variable_cache< Var_type >::initialize_client_session

Build array of SHOW_VARs suitable for aggregation by user, host or account.

Filter using session scope.

◆ initialize_session()

template<class Var_type >
bool PFS_variable_cache< Var_type >::initialize_session

Build array of SHOW_VARs from the external variable source.

Build array of SHOW_VARs from external source of system or status variables.

Filter using session scope.

◆ is_materialized() [1/7]

template<class Var_type >
bool PFS_variable_cache< Var_type >::is_materialized ( )
inline

True if variables have been materialized.

◆ is_materialized() [2/7]

template<class Var_type >
bool PFS_variable_cache< Var_type >::is_materialized ( PFS_account pfs_account)
inline

True if variables have been materialized for given PFS_account.

◆ is_materialized() [3/7]

template<class Var_type >
bool PFS_variable_cache< Var_type >::is_materialized ( PFS_client pfs_client)
inline

True if variables have been materialized for given PFS_user/host/account.

◆ is_materialized() [4/7]

template<class Var_type >
bool PFS_variable_cache< Var_type >::is_materialized ( PFS_host pfs_host)
inline

True if variables have been materialized for given PFS_host.

◆ is_materialized() [5/7]

template<class Var_type >
bool PFS_variable_cache< Var_type >::is_materialized ( PFS_thread pfs_thread)
inline

True if variables have been materialized for given PFS_thread.

◆ is_materialized() [6/7]

template<class Var_type >
bool PFS_variable_cache< Var_type >::is_materialized ( PFS_user pfs_user)
inline

True if variables have been materialized for given PFS_user.

◆ is_materialized() [7/7]

template<class Var_type >
bool PFS_variable_cache< Var_type >::is_materialized ( THD unsafe_thd)
inline

True if variables have been materialized for given THD.

◆ materialize_account()

template<class Var_type >
int PFS_variable_cache< Var_type >::materialize_account ( PFS_account pfs_account)

Build cache of SESSION status variables for an account.

◆ materialize_all()

template<class Var_type >
int PFS_variable_cache< Var_type >::materialize_all ( THD thd)

Build cache of GLOBAL and SESSION variables for a non-instrumented thread.

◆ materialize_global()

template<class Var_type >
int PFS_variable_cache< Var_type >::materialize_global

Build cache of GLOBAL system or status variables.

Build cache of all GLOBAL variables.

Aggregate across threads if applicable.

◆ materialize_host()

template<class Var_type >
int PFS_variable_cache< Var_type >::materialize_host ( PFS_host pfs_host)

Build cache of SESSION status variables for a host.

◆ materialize_session() [1/3]

template<class Var_type >
int PFS_variable_cache< Var_type >::materialize_session ( PFS_thread pfs_thread,
bool  use_mem_root = false 
)

Build cache of SESSION variables for an instrumented thread.

Build cache of SESSION variables for a thread.

◆ materialize_session() [2/3]

template<class Var_type >
int PFS_variable_cache< Var_type >::materialize_session ( PFS_thread pfs_thread,
uint  index 
)

Cache a single SESSION variable for an instrumented thread.

Materialize a single variable for a thread.

◆ materialize_session() [3/3]

template<class Var_type >
int PFS_variable_cache< Var_type >::materialize_session ( THD thd)

Build cache of SESSION variables for a non-instrumented thread.

◆ materialize_user()

template<class Var_type >
int PFS_variable_cache< Var_type >::materialize_user ( PFS_user pfs_user)

Build cache of SESSION status variables for a user.

◆ size()

template<class Var_type >
uint PFS_variable_cache< Var_type >::size ( )
inline

Number of elements in the cache.

Member Data Documentation

◆ m_aggregate

template<class Var_type >
bool PFS_variable_cache< Var_type >::m_aggregate
protected

◆ m_cache

template<class Var_type >
Variable_array PFS_variable_cache< Var_type >::m_cache
protected

◆ m_current_thd

template<class Var_type >
THD* PFS_variable_cache< Var_type >::m_current_thd
protected

◆ m_external_init

template<class Var_type >
bool PFS_variable_cache< Var_type >::m_external_init
protected

◆ m_initialized

template<class Var_type >
bool PFS_variable_cache< Var_type >::m_initialized
protected

◆ m_materialized

template<class Var_type >
bool PFS_variable_cache< Var_type >::m_materialized
protected

◆ m_pfs_client

template<class Var_type >
PFS_client* PFS_variable_cache< Var_type >::m_pfs_client
protected

◆ m_pfs_thread

template<class Var_type >
PFS_thread* PFS_variable_cache< Var_type >::m_pfs_thread
protected

◆ m_query_scope

template<class Var_type >
enum_var_type PFS_variable_cache< Var_type >::m_query_scope
protected

◆ m_safe_thd

template<class Var_type >
THD* PFS_variable_cache< Var_type >::m_safe_thd
protected

◆ m_show_var_array

template<class Var_type >
Show_var_array PFS_variable_cache< Var_type >::m_show_var_array
protected

◆ m_sys_var_tracker_array

template<class Var_type >
System_variable_tracker::Array PFS_variable_cache< Var_type >::m_sys_var_tracker_array
protected

◆ m_thd_finder

template<class Var_type >
Find_THD_variable PFS_variable_cache< Var_type >::m_thd_finder
protected

◆ m_unsafe_thd

template<class Var_type >
THD* PFS_variable_cache< Var_type >::m_unsafe_thd
protected

◆ m_use_mem_root

template<class Var_type >
bool PFS_variable_cache< Var_type >::m_use_mem_root
protected

◆ m_version

template<class Var_type >
ulonglong PFS_variable_cache< Var_type >::m_version
protected

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