![]() |
MySQL 9.4.0
Source Code Documentation
|
Status variable cache. More...
#include <pfs_variable.h>
Public Member Functions | |
| PFS_status_variable_cache (bool external_init) | |
| CLASS PFS_status_variable_cache. 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... | |
| ulonglong | get_status_array_version () |
Public Member Functions inherited from PFS_variable_cache< Status_variable > | |
| 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 Status_variable * | get (uint index=0) const |
| Get a single variable from the cache. More... | |
| uint | size () |
| Number of elements in the cache. More... | |
Protected Member Functions | |
| virtual PFS_client * | get_pfs (PFS_thread *) |
Protected Attributes | |
| bool | m_show_command |
Protected Attributes inherited from PFS_variable_cache< Status_variable > | |
| THD * | m_safe_thd |
| THD * | m_unsafe_thd |
| THD * | m_current_thd |
| PFS_thread * | m_pfs_thread |
| PFS_client * | m_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 | |
| bool | do_initialize_session () override |
| Build an internal SHOW_VAR array from the external status variable array. More... | |
| int | do_materialize_global () override |
| Build cache for GLOBAL status variables using values totaled from all threads. More... | |
| int | do_materialize_all (THD *thd) override |
| Build GLOBAL and SESSION status variable cache using values for a non-instrumented thread. More... | |
| int | do_materialize_session (THD *thd) override |
| Build SESSION status variable cache using values for a non-instrumented thread. More... | |
| int | do_materialize_session (PFS_thread *thread) override |
| Build SESSION status variable cache using values for a PFS_thread. More... | |
| int | do_materialize_session (PFS_thread *, uint) override |
| int | do_materialize_client (PFS_client *pfs_client) |
| Build cache of SESSION status variables using the status values provided. More... | |
| bool | init_show_var_array (enum_var_type scope, bool strict) |
| Build an array of SHOW_VARs from the global status array. More... | |
| void | expand_show_var_array (const SHOW_VAR *show_var_array, const char *prefix, bool strict) |
| Expand a nested sub array of status variables, indicated by a type of SHOW_ARRAY. More... | |
| bool | filter_show_var (const SHOW_VAR *show_var, bool strict) |
| Check if a status variable should be excluded from the query. More... | |
| bool | match_scope (SHOW_SCOPE variable_scope, bool strict) |
| Compare status variable scope to desired scope. More... | |
| bool | filter_by_name (const SHOW_VAR *show_var) |
| bool | can_aggregate (enum_mysql_show_type variable_type) |
| Check that the variable type is aggregatable. More... | |
| char * | make_show_var_name (const char *prefix, const char *name, char *name_buf, size_t buf_len) |
| Build the complete status variable name, with prefix. More... | |
| char * | make_show_var_name (const char *prefix, const char *name) |
| Make a copy of the name string prefixed with the sub array name if necessary. More... | |
| System_status_var * | set_status_vars () |
| For the current THD, use initial_status_vars taken from before the query start. More... | |
| void | manifest (THD *thd, const SHOW_VAR *show_var_array, System_status_var *vars, const char *prefix, bool nested_array, bool strict) |
Private Attributes | |
| void(* | m_sum_client_status )(PFS_client *pfs_client, System_status_var *status_totals) |
Additional Inherited Members | |
Public Types inherited from PFS_variable_cache< Status_variable > | |
| typedef Prealloced_array< Status_variable, SYSTEM_VARIABLE_PREALLOC > | Variable_array |
Status variable cache.
|
explicit |
CLASS PFS_status_variable_cache.
|
private |
Check that the variable type is aggregatable.
| variable_type | Status variable type |
|
overrideprivatevirtual |
Build an internal SHOW_VAR array from the external status variable array.
Reimplemented from PFS_variable_cache< Status_variable >.
|
overrideprivatevirtual |
Build GLOBAL and SESSION status variable cache using values for a non-instrumented thread.
Reimplemented from PFS_variable_cache< Status_variable >.
|
private |
Build cache of SESSION status variables using the status values provided.
The cache is associated with a user, host or account, but not with any particular thread. NOTE: Requires that init_show_var_array() has already been called.
|
overrideprivatevirtual |
Build cache for GLOBAL status variables using values totaled from all threads.
Reimplemented from PFS_variable_cache< Status_variable >.
|
inlineoverrideprivatevirtual |
Reimplemented from PFS_variable_cache< Status_variable >.
|
overrideprivatevirtual |
Build SESSION status variable cache using values for a PFS_thread.
NOTE: Requires that init_show_var_array() has already been called.
Reimplemented from PFS_variable_cache< Status_variable >.
|
overrideprivatevirtual |
Build SESSION status variable cache using values for a non-instrumented thread.
Reimplemented from PFS_variable_cache< Status_variable >.
|
private |
Expand a nested sub array of status variables, indicated by a type of SHOW_ARRAY.
|
private |
|
private |
Check if a status variable should be excluded from the query.
Return true if the variable should be excluded.
|
inlineprotectedvirtual |
|
inline |
|
private |
Build an array of SHOW_VARs from the global status array.
Expand nested sub arrays, filter unwanted variables. NOTE: Must be done inside of LOCK_status to guard against plugin load/unload.
|
private |
Make a copy of the name string prefixed with the sub array name if necessary.
|
private |
Build the complete status variable name, with prefix.
Return in buffer provided.
|
private |
|
private |
Compare status variable scope to desired scope.
| variable_scope | Scope of current status variable |
| strict | Strict mode, for compatibility with SHOW |
| int PFS_status_variable_cache::materialize_account | ( | PFS_account * | pfs_account | ) |
Build cache of SESSION status variables for an account.
| int PFS_status_variable_cache::materialize_host | ( | PFS_host * | pfs_host | ) |
Build cache of SESSION status variables for a host.
| int PFS_status_variable_cache::materialize_user | ( | PFS_user * | pfs_user | ) |
Build cache of SESSION status variables for a user.
|
private |
For the current THD, use initial_status_vars taken from before the query start.
|
protected |
|
private |