Server utility class.
More...
#include <health_monitor_server.h>
Server utility class.
Provides server information, status and utilities.
◆ clear_offline_mode()
| bool hm::Server::clear_offline_mode |
( |
| ) |
|
|
static |
Clear OFFLINE_MODE, set to OFF.
- Returns
- false if successful, true otherwise
◆ clear_read_only()
| bool hm::Server::clear_read_only |
( |
| ) |
|
|
static |
Clear READ_ONLY, set to OFF.
Setting READ_ONLY = OFF also sets SUPER_READ_ONLY = OFF.
- Returns
- false if successful, true otherwise
◆ clear_super_read_only()
| bool hm::Server::clear_super_read_only |
( |
| ) |
|
|
static |
Clear SUPER_READ_ONLY, set to OFF.
- Returns
- false if successful, true otherwise
◆ get_fg_sessions_with_global_lock()
Get list of foreground sessions holding a global read lock.
Only one session is expected, but this will accommodate multiple ids. Filter protected service accounts, allow root for MTR.
- Returns
- String vector with 0 or more processlist ids
◆ get_group_replication_status()
| GR_Status hm::Server::get_group_replication_status |
( |
| ) |
|
|
static |
Get the current group replication status.
Group replication status is dynamic and must be refreshed for each check.
- Returns
- GR_Status
◆ get_log_diagnostic_enable()
| bool hm::Server::get_log_diagnostic_enable |
( |
bool & |
error | ) |
|
|
static |
Get the value of LOG_DIAGNOSTIC_ENABLE.
- Returns
- true if LOG_DIAGNOSTIC_ENABLE = ON, false otherwise
◆ get_offline_mode()
| bool hm::Server::get_offline_mode |
( |
bool & |
error | ) |
|
|
static |
Get the value of OFFLINE_MODE.
- Parameters
-
| [in,out] | error | Error code, 0 if successful |
- Returns
- true if OFFLINE_MODE = ON, false otherwise
◆ get_offline_mode_str()
| std::string hm::Server::get_offline_mode_str |
( |
| ) |
|
|
static |
OFFLINE_MODE message string.
- Returns
- "OFFLINE_MODE = ON/OFF" or "" if error
◆ get_read_only()
| bool hm::Server::get_read_only |
( |
bool & |
error | ) |
|
|
static |
Get the value of READ_ONLY.
- Returns
- true if READ_ONLY = ON, false otherwise
◆ get_status_variable()
| bool hm::Server::get_status_variable |
( |
const std::string & |
name, |
|
|
std::string & |
value |
|
) |
| |
|
static |
Get server global status variable.
- Parameters
-
| [in] | name | variable name |
| [out] | value | variable value |
- Returns
- false if successful, true otherwise
◆ get_super_read_only()
| bool hm::Server::get_super_read_only |
( |
bool & |
error | ) |
|
|
static |
Get the value of SUPER_READ_ONLY.
- Parameters
-
| [in,out] | error | Error code, 0 if successful |
- Returns
- true if SUPER_READ_ONLY = ON, false otherwise
◆ get_super_read_only_str()
| std::string hm::Server::get_super_read_only_str |
( |
| ) |
|
|
static |
SUPER_READ_ONLY message string.
- Returns
- "SUPER_READ_ONLY = ON/OFF" or "" if error
◆ get_system_variable()
| bool hm::Server::get_system_variable |
( |
const std::string & |
name, |
|
|
std::string & |
value |
|
) |
| |
|
static |
Get server system variable.
- Parameters
-
| [in] | name | variable name |
| [out] | value | variable value |
- Returns
- false if successful, true otherwise
◆ gr_status()
Get the group replication status.
- Returns
- GR_Status
◆ is_group_replication_primary()
| bool hm::Server::is_group_replication_primary |
( |
| ) |
|
|
static |
Determine if the server is a group replication primary.
- Returns
- true if server is a primary, false otherwise
◆ is_group_replication_secondary()
| bool hm::Server::is_group_replication_secondary |
( |
| ) |
|
|
static |
Determine if the server is a group replication secondary.
- Returns
- true if server is a secondary, false otherwise
◆ is_member_online_with_group_majority()
| bool hm::Server::is_member_online_with_group_majority |
( |
| ) |
|
|
static |
Determine if the server is online and in a group majority.
- Returns
- true if server is in a group majority, false otherwise
◆ kill_connection() [1/2]
| int hm::Server::kill_connection |
( |
const std::string & |
pid | ) |
|
Terminate a server thread given a processlist id.
- Parameters
-
| [in] | pid | Processlist id string |
- Returns
- 0 Success, 1 query error
◆ kill_connection() [2/2]
| int hm::Server::kill_connection |
( |
const std::string & |
pid, |
|
|
std::string & |
errmsg |
|
) |
| |
Terminate a server thread given a proceslist id.
Note that mysql client apps may attempt to reconnect. Issue warning if command fails.
- Parameters
-
| [in] | pid | Processlist id string |
| [out] | errmsg | Error message if any |
- Returns
- 0 Success, 1 query error
◆ kill_query() [1/2]
| int hm::Server::kill_query |
( |
const std::string & |
pid | ) |
|
Terminate the query running on a connection.
- Parameters
-
| [in] | pid | Processlist id string |
- Returns
- 0 Success, 1 query error
◆ kill_query() [2/2]
| int hm::Server::kill_query |
( |
const std::string & |
pid, |
|
|
std::string & |
errmsg |
|
) |
| |
Terminate the query running on a connection.
Return error message if command fails.
- Parameters
-
| [in] | pid | Processlist id string |
| [out] | errmsg | Error message if any |
- Returns
- 0 Success, 1 query error
◆ processlist_id_list()
Build a list of processlist ids from a result set.
- Parameters
-
- Returns
- String vector with 0 or more processlist ids
◆ register_group_member_status_listeners()
| int hm::Server::register_group_member_status_listeners |
( |
| ) |
|
|
static |
Register the group member status listener.
- Returns
- 0 if successful, non-zero otherwise
◆ set_group_replication_status()
| void hm::Server::set_group_replication_status |
( |
const char * |
view_id | ) |
|
|
static |
Set the internal group replication status.
- Parameters
-
| view_id | Group replication view id |
◆ set_offline_mode()
| bool hm::Server::set_offline_mode |
( |
| ) |
|
|
static |
Set OFFLINE_MODE = ON.
- Returns
- false if successful, true otherwise
◆ set_super_read_only()
| bool hm::Server::set_super_read_only |
( |
| ) |
|
|
static |
Set SUPER_READ_ONLY = ON.
Setting SUPER_READ_ONLY = ON also sets READ_ONLY = ON.
- Returns
- false if successful, true otherwise
◆ set_system_variable()
| bool hm::Server::set_system_variable |
( |
const std::string & |
name, |
|
|
const std::string & |
value |
|
) |
| |
|
static |
Set server system variable.
- Parameters
-
| [in] | name | variable name |
| [in] | value | variable value |
- Returns
- false if successful, true otherwise
◆ to_lower()
| std::string & hm::Server::to_lower |
( |
std::string & |
str | ) |
|
|
static |
Convert string to lower case.
- Parameters
-
- Returns
- Converted string
◆ unregister_group_member_status_listeners()
| int hm::Server::unregister_group_member_status_listeners |
( |
| ) |
|
|
static |
Unregister the group member status listener.
- Returns
- 0 if successful, non-zero otherwise
◆ m_gr_mutex
| std::shared_mutex hm::Server::m_gr_mutex |
|
staticprivate |
Initialize static members.
◆ m_gr_status
Group replication status.
The documentation for this class was generated from the following files: