MySQL 8.4.2
Source Code Documentation
|
Namespaces | |
namespace | anonymous_namespace{random_generator.cc} |
namespace | anonymous_namespace{string_utils.cc} |
namespace | detail |
namespace | impl |
namespace | loader |
namespace | logging |
namespace | posix |
namespace | utility |
Classes | |
class | bad_option |
Exception thrown for option problems. More... | |
class | bad_option_value |
Exception thrown for option value problems. More... | |
class | bad_section |
Exception thrown for section problems. More... | |
class | BasePluginConfig |
Retrieve and manage plugin configuration. More... | |
class | BoolOption |
class | BuiltinPlugins |
Singleton class implementing registry of the built-in MySQLRouter plugins. More... | |
class | Config |
Configuration. More... | |
class | ConfigBuilder |
builder for MySQL Router config files. More... | |
class | ConfigSection |
Configuration section. More... | |
class | decryption_error |
class | DIM |
class | Directory |
Class representing a directory in a file system. More... | |
class | DurationOption |
class | DynamicConfig |
Respresents the current Router configuration. More... | |
class | DynamicLibrary |
A DynamicLibrary. More... | |
class | DynamicLoader |
Loader for DynamicLibrary. More... | |
class | DynamicState |
DynamicState represents a MySQLRouter dynamic state object. More... | |
class | EventStateTracker |
EventStateTracker singleton object keeps track of the current known state of selected event. More... | |
class | FakeRandomGenerator |
class | FloatingPointOption |
class | IntOption |
class | invalid_master_keyfile |
class | Keyring |
Keyring interface. More... | |
class | KeyringFile |
KeyringFile class. More... | |
class | KeyringMemory |
KeyringMemory class. More... | |
class | Loader |
class | LoaderConfig |
Configuration file handler for the loader. More... | |
class | LogReopen |
class | LogReopenComponent |
component that manages the reopening of logfiles. More... | |
class | MasterKeyFile |
class | MPMCQueueMS2Lock |
a unbounded multi-producer multi-consumer queue. More... | |
class | MPSCQueueDV |
a unbounded multi-producer single-consumer queue. More... | |
struct | mysql_router_thread_handle |
class | MySQLRouterThread |
MySQLRouterThread provides higher level interface to managing threads. More... | |
class | option_empty |
Exception that gets thrown when the configuration option is present but it is empty value. More... | |
class | option_not_present |
Exception that gets thrown when the configuration option is missing. More... | |
class | Path |
Class representing a path in a file system. More... | |
class | PluginFuncEnv |
PluginFuncEnv object. More... | |
class | PluginThreads |
class | ProcessLauncher |
class | ProcessStateComponent |
manages the state of the process. More... | |
class | RandomGenerator |
class | RandomGeneratorInterface |
class | Range |
Convenience class for handling iterator range. More... | |
class | SectionConfigExposer |
Base class for a plugin specific specializations. More... | |
class | ShutdownPending |
class | SignalHandler |
class | SocketOperations |
This class provides a "real" (not mock) implementation. More... | |
class | SocketOperationsBase |
Base class to allow multiple SocketOperations implementations (at least one "real" and one mock for testing purposes) More... | |
class | SpawnedProcess |
an alive, spawned process More... | |
class | StringOption |
class | syntax_error |
Exception thrown for syntax errors. More... | |
class | TCPAddress |
Defines an IP address with port number More... | |
class | UniquePtr |
class | WaitingQueueAdaptor |
provide waiting pop and push operator to thread-safe queues. More... | |
Typedefs | |
using | security_descriptor_type = posix::access_rights::security_descriptor_type |
using | DenyOtherReadWritableVerifier = posix::access_rights::DenyPermissionVerifier<(S_IRWXO)> |
fail access_rights_verify() if others can read or write or execute. More... | |
using | AllowUserReadWritableVerifier = posix::access_rights::AllowPermissionVerifier<(S_IRUSR|S_IWUSR)> |
fail access_rights_verify() if someone else then the owner of the file can read or write. More... | |
using | DoubleOption = FloatingPointOption< double > |
using | MilliSecondsOption = DurationOption< std::chrono::milliseconds > |
a double option with milli-second precision. More... | |
using | JsonAllocator = rapidjson::CrtAllocator |
using | JsonValue = rapidjson::GenericValue< rapidjson::UTF8<>, JsonAllocator > |
using | perm_mode = mode_t |
template<typename T > | |
using | MPMCQueue = MPMCQueueMS2Lock< T > |
template<typename T > | |
using | WaitingMPMCQueue = WaitingQueueAdaptor< MPMCQueue< T > > |
template<typename T > | |
using | MPSCQueue = MPSCQueueDV< T > |
template<typename T > | |
using | WaitingMPSCQueue = WaitingQueueAdaptor< MPSCQueue< T > > |
using | Ssl = std::unique_ptr< SSL, mysql_harness::impl::Deleter_SSL > |
typedef pthread_t | mysql_router_thread_t |
typedef pthread_attr_t | mysql_router_thread_attr_t |
typedef void *(* | my_start_routine) (void *) |
using | socket_t = net::impl::socket::native_handle_type |
Enumerations | |
enum class | DynamicLoaderErrc { kDlError = 1 } |
error-codes of the DynamicLoader and DynamicLibrary. More... | |
Functions | |
HARNESS_EXPORT std::string | truncate_string (const std::string &str, size_t max_len=80) |
Return a truncated version of input string. More... | |
template<class InputIt > | |
void | serial_comma (std::ostream &out, InputIt start, InputIt finish, const std::string &delim="and") |
Emit a range of elements using the serial comma. More... | |
template<class InputIt > | |
std::string | serial_comma (InputIt start, InputIt finish, const std::string &delim="and") |
Returns string containing list of the elements using the serial comma. More... | |
template<class Key , class Value > | |
Value | get_from_map (const std::map< Key, Value > &map, const Key &key, const Value &default_value) |
Gets a Value from std::map for given Key. More... | |
template<class T > | |
std::string | hexify (const T &buf) |
hexdump into a string. More... | |
bool HARNESS_EXPORT | is_valid_ip_address (const std::string &address) |
bool HARNESS_EXPORT | is_valid_hostname (const std::string &address) |
check if address is a hostname. More... | |
bool HARNESS_EXPORT | is_valid_domainname (const std::string &address) |
check if address is a domainname. More... | |
HARNESS_EXPORT bool | init_keyring (const std::string &keyring_file_path, const std::string &master_key_path, bool create_if_needed) |
Initialize an instance of a keyring to be used in the application from the contents of a file, using the given master key file. More... | |
HARNESS_EXPORT bool | init_keyring_with_key (const std::string &keyring_file_path, const std::string &master_key, bool create_if_needed) |
Initialize an instance of a keyring to be used in the application from the contents of a file, using the given master key. More... | |
HARNESS_EXPORT void | flush_keyring () |
Saves the keyring contents to disk. More... | |
HARNESS_EXPORT Keyring * | get_keyring () noexcept |
Gets a previously initialized singleton instance of the keyring. More... | |
HARNESS_EXPORT void | reset_keyring () noexcept |
Clears the keyring singleton. More... | |
HARNESS_EXPORT stdx::expected< security_descriptor_type, std::error_code > | access_rights_get (const std::string &file_name) noexcept |
get a access rights of file. More... | |
template<class Func > | |
stdx::expected< void, std::error_code > | access_rights_verify (const security_descriptor_type &rights, Func &&func) |
check if a security descriptor satisfies a verifier. More... | |
HARNESS_EXPORT stdx::expected< void, std::error_code > | access_rights_set (const std::string &file_name, const security_descriptor_type &sec_desc) |
set access rights of a file. More... | |
double HARNESS_EXPORT | option_as_double (const std::string &value, const std::string &option_desc, double min_value=0, double max_value=std::numeric_limits< double >::max()) |
template<typename T > | |
T | option_as_int (const std::string_view &value, const std::string &option_desc, T min_value=std::numeric_limits< T >::min(), T max_value=std::numeric_limits< T >::max()) |
Gets an integer using the given option value. More... | |
template<typename T > | |
T | option_as_uint (const std::string_view &value, const std::string &option_desc, T min_value=std::numeric_limits< T >::min(), T max_value=std::numeric_limits< T >::max()) |
Get a unsigned integer. More... | |
bool HARNESS_EXPORT | is_valid_conf_ident_char (const char ch) |
Returns true if a character given as a parameter is valid for config identifier (section, section key or option name) More... | |
std::error_code | make_error_code (DynamicLoaderErrc ec) |
make error_code from a DynamicLoaderErrc. More... | |
HARNESS_EXPORT stdx::expected< void, std::error_code > | delete_dir (const std::string &dir) noexcept |
Removes a directory. More... | |
HARNESS_EXPORT stdx::expected< void, std::error_code > | delete_file (const std::string &path) noexcept |
Removes a file. More... | |
HARNESS_EXPORT stdx::expected< void, std::error_code > | delete_dir_recursive (const std::string &dir) noexcept |
Removes directory and all its contents. More... | |
HARNESS_EXPORT std::string | get_tmp_dir (const std::string &name="router") |
Creates a temporary directory with partially-random name and returns its path. More... | |
HARNESS_EXPORT std::string | get_plugin_dir (const std::string &runtime_dir) |
HARNESS_EXPORT std::string | get_tests_data_dir (const std::string &runtime_dir) |
HARNESS_EXPORT int | mkdir (const std::string &dir, perm_mode mode, bool recursive=false) |
Creates a directory *. More... | |
void HARNESS_EXPORT | make_file_public (const std::string &file_name) |
Changes file access permissions to be fully accessible by all users. More... | |
void HARNESS_EXPORT | make_file_private (const std::string &file_name, const bool read_only_for_local_service=true) |
Changes file access permissions to be accessible only by a limited set of users. More... | |
void HARNESS_EXPORT | make_file_readonly (const std::string &file_name) |
Changes file access permissions to be read only. More... | |
void HARNESS_EXPORT | check_file_access_rights (const std::string &file_name) |
Verifies access permissions of a file. More... | |
std::string HARNESS_EXPORT | to_string (const ShutdownPending::Reason &reason) |
bool HARNESS_EXPORT | notify_status (const std::string &msg) |
bool HARNESS_EXPORT | notify_ready () |
bool HARNESS_EXPORT | notify_stopping () |
HARNESS_EXPORT std::vector< std::string > | split_string (const std::string_view &data, const char delimiter, bool allow_empty=true) |
Splits a string using a delimiter. More... | |
HARNESS_EXPORT void | left_trim (std::string &str) |
Removes leading whitespaces from the string. More... | |
HARNESS_EXPORT void | right_trim (std::string &str) |
Removes trailing whitespaces from the string. More... | |
HARNESS_EXPORT void | trim (std::string &str) |
Removes both leading and trailing whitespaces from the string. More... | |
HARNESS_EXPORT std::string | limit_lines (const std::string &str, const size_t limit, const std::string &replace_with="") |
Returns the input string with number of lines reduced to selected value. More... | |
template<class Container > | |
std::string | join (Container cont, const std::string &delim) |
join elements of an container into a string separated by a delimiter. More... | |
template<class T > | |
constexpr bool | str_in_collection (const T &t, const std::string_view &k) |
HARNESS_EXPORT stdx::expected< TCPAddress, std::error_code > | make_tcp_address (const std::string &endpoint) |
create TCPAddress from endpoint string. More... | |
static void | inplace_lower (std::string *str) |
static std::string | lower (std::string_view str) |
static void | check_option (std::string_view str) |
const std::error_category & | dynamic_loader_category () noexcept |
int | mkdir_wrapper (const std::string &dir, perm_mode mode) |
static stdx::expected< void, std::error_code > | make_file_private_win32 (const std::string &filename, const bool read_only_for_local_service) |
Makes a file fully accessible by the current process user and (read only or read/write depending on the second argument) for LocalService account (which is the account under which the MySQL router runs as service). More... | |
static stdx::expected< void, std::error_code > | set_everyone_group_access_rights (const std::string &file_name, DWORD mask) |
Sets file permissions for Everyone group. More... | |
void | make_file_readable_for_everyone (const std::string &file_name) |
static const char * | file_type_name (Path::FileType type) |
std::ostream & | operator<< (std::ostream &out, Path::FileType type) |
int | mkdir_recursive (const Path &path, perm_mode mode) |
static void | verify_file_permissions (const std::string &file_name) |
static std::pair< std::string, std::string > | get_master_key (MasterKeyFile &mkf, const std::string &keyring_file_path, bool create_if_needed) |
Gets the master_key for the specified keyring_file from the master key store. More... | |
static std::pair< std::string, std::string > | create_initial_keyring_pair (MasterKeyFile &mkf, const std::string &keyring_file_path, std::string master_scramble) |
const AppInfo * | get_app_info (const PluginFuncEnv *env) noexcept |
const ConfigSection * | get_config_section (const PluginFuncEnv *env) noexcept |
bool | is_running (const PluginFuncEnv *env) noexcept |
bool | wait_for_stop (const PluginFuncEnv *env, uint32_t milliseconds) noexcept |
void | clear_running (PluginFuncEnv *env) noexcept |
void | set_error (PluginFuncEnv *env, ErrorType error_type, const char *fmt,...) noexcept |
template<class T > | |
T | value_or (T a, T b) |
If a isn't set, return b. More... | |
static void | call_plugin_function (PluginFuncEnv *env, std::exception_ptr &eptr, void(*fptr)(PluginFuncEnv *), const char *fnc_name, const char *plugin_name, const char *plugin_key=nullptr) noexcept |
static std::string | section_to_string (const ConfigSection *section) |
static void | report_unsupported_option (const std::string §ion, const std::string &option, const bool error_out) |
void | on_service_ready (const std::string &name) |
void | on_service_ready (PluginFuncEnv *plugin_env) |
static int | mysql_router_thread_attr_init (mysql_router_thread_attr_t *attr) |
static int | mysql_router_thread_attr_setstacksize (mysql_router_thread_attr_t *attr, size_t stacksize) |
static int | mysql_router_thread_attr_setdetachstate (mysql_router_thread_attr_t *attr, int detachstate) |
static bool | mysql_router_thread_started (const mysql_router_thread_handle *thread) |
checks if thread pointed by thread was started More... | |
static bool | mysql_router_thread_joinable (const mysql_router_thread_attr_t *attr) |
checks if thread pointed by attr is joinable More... | |
int | mysql_router_thread_create (mysql_router_thread_handle *thread, const mysql_router_thread_attr_t *attr, my_start_routine func, void *arg) |
int | mysql_router_thread_join (mysql_router_thread_handle *thread, void **value_ptr) |
static std::string | option_description (std::string_view section_name, std::string_view option) |
static std::error_code | last_error_code () noexcept |
static std::vector< const char * > | get_params (const std::string &command, const std::vector< std::string > ¶ms_vec) |
static auto | get_env_vars_vector (const std::vector< std::pair< std::string, std::string > > &env_vars) |
static auto | get_env_vars (const std::vector< std::string > &env_vars) |
static std::string | get_notify_socket_name () |
static stdx::expected< local::datagram_protocol::socket, std::error_code > | connect_to_notify_socket (net::io_context &io_ctx, const std::string &socket_name) |
static stdx::expected< void, std::error_code > | notify (const std::string &msg, const std::string &socket_name) |
static bool | notify (const std::string &msg) |
static void | shrink (std::string &s) |
static stdx::expected< std::string, std::error_code > | endpoint_to_name (const net::ip::tcp::endpoint &ep) |
static SocketOperationsBase::LocalHostnameResolutionError | make_local_hostname_resolution_error (const std::error_code &ec) |
static stdx::expected< TCPAddress, std::error_code > | make_tcp_address_ipv6 (const std::string &endpoint) |
Variables | |
static const int | kMaxKeyringKeyLength = 255 |
HARNESS_EXPORT const perm_mode | kStrictDirectoryPerm = S_IRWXU |
static constexpr std::array | loader_supported_options |
static const size_t | kDefaultStackSizeInKiloBytes = 1024 |
static constexpr mysql_router_thread_t | null_thread_initializer |
constexpr socket_t | kInvalidSocket = net::impl::socket::kInvalidSocket |
static std::unique_ptr< KeyringFile > | g_keyring |
static std::string | g_keyring_file_path |
static std::string | g_keyring_key |
static const unsigned | kKeyLength = 32 |
static const std::array< char, 5 > | kMasterKeyFileSignature |
static constexpr unsigned char | kAesIv [] |
constexpr auto | kTerminateWaitInterval = std::chrono::seconds(10) |
constexpr auto | kWaitPidCheckInterval = std::chrono::milliseconds(10) |
maximum number of parameters that can be passed to the launched process More... | |
using mysql_harness::AllowUserReadWritableVerifier = typedef posix::access_rights::AllowPermissionVerifier<(S_IRUSR | S_IWUSR)> |
fail access_rights_verify() if someone else then the owner of the file can read or write.
using mysql_harness::DenyOtherReadWritableVerifier = typedef posix::access_rights::DenyPermissionVerifier<(S_IRWXO)> |
fail access_rights_verify() if others can read or write or execute.
using mysql_harness::DoubleOption = typedef FloatingPointOption<double> |
using mysql_harness::JsonAllocator = typedef rapidjson::CrtAllocator |
using mysql_harness::JsonValue = typedef rapidjson::GenericValue<rapidjson::UTF8<>, JsonAllocator> |
using mysql_harness::MilliSecondsOption = typedef DurationOption<std::chrono::milliseconds> |
a double option with milli-second precision.
input is seconds as double. output is a std::chrono::millisecond
using mysql_harness::MPMCQueue = typedef MPMCQueueMS2Lock<T> |
using mysql_harness::MPSCQueue = typedef MPSCQueueDV<T> |
typedef void *(* mysql_harness::my_start_routine) (void *) |
typedef pthread_attr_t mysql_harness::mysql_router_thread_attr_t |
typedef pthread_t mysql_harness::mysql_router_thread_t |
using mysql_harness::perm_mode = typedef mode_t |
using mysql_harness::security_descriptor_type = typedef posix::access_rights::security_descriptor_type |
using mysql_harness::socket_t = typedef net::impl::socket::native_handle_type |
using mysql_harness::Ssl = typedef std::unique_ptr<SSL, mysql_harness::impl::Deleter_SSL> |
using mysql_harness::WaitingMPMCQueue = typedef WaitingQueueAdaptor<MPMCQueue<T> > |
using mysql_harness::WaitingMPSCQueue = typedef WaitingQueueAdaptor<MPSCQueue<T> > |
|
strong |
|
noexcept |
get a access rights of file.
file_name | of a file. |
stdx::expected< void, std::error_code > mysql_harness::access_rights_set | ( | const std::string & | file_name, |
const security_descriptor_type & | sec_desc | ||
) |
set access rights of a file.
stdx::expected< void, std::error_code > mysql_harness::access_rights_verify | ( | const security_descriptor_type & | rights, |
Func && | func | ||
) |
check if a security descriptor satisfies a verifier.
|
staticnoexcept |
void mysql_harness::check_file_access_rights | ( | const std::string & | file_name | ) |
Verifies access permissions of a file.
On Unix systems it throws if file's permissions differ from 600. On Windows it throws if file can be accessed by Everyone group.
[in] | file_name | File to be verified. |
std::exception | File access rights are too permissive or an error occurred. |
std::system_error | OS and/or filesystem doesn't support file permissions. |
|
static |
|
noexcept |
|
static |
|
static |
|
noexcept |
|
static |
|
static |
void mysql_harness::flush_keyring | ( | ) |
Saves the keyring contents to disk.
|
noexcept |
|
noexcept |
|
static |
|
static |
Value mysql_harness::get_from_map | ( | const std::map< Key, Value > & | map, |
const Key & | key, | ||
const Value & | default_value | ||
) |
Gets a Value from std::map for given Key.
Returns provided default if the Key is not in the map.
|
noexcept |
Gets a previously initialized singleton instance of the keyring.
|
static |
Gets the master_key for the specified keyring_file from the master key store.
If the master key store file does not exist, it will be created along with a new master_key, which will be stored and also returned. If the master key store already exists, but does not have an entry for the master key, it will be generated and then stored.
Returns the master_key and the scramble for the master_key
|
static |
|
static |
std::string mysql_harness::get_plugin_dir | ( | const std::string & | runtime_dir | ) |
std::string mysql_harness::get_tests_data_dir | ( | const std::string & | runtime_dir | ) |
|
inline |
hexdump into a string.
converts the contents of continous container (has .data() and .size()) as hex values in rows of 16 bytes.
buf | a container |
bool mysql_harness::init_keyring | ( | const std::string & | keyring_file_path, |
const std::string & | master_key_path, | ||
bool | create_if_needed | ||
) |
Initialize an instance of a keyring to be used in the application from the contents of a file, using the given master key file.
keyring_file_path | path to the file where keyring is stored |
master_key_path | path to the file keyring master keys are stored |
create_if_needed | creates the keyring if it doesn't exist yet |
bool mysql_harness::init_keyring_with_key | ( | const std::string & | keyring_file_path, |
const std::string & | master_key, | ||
bool | create_if_needed | ||
) |
Initialize an instance of a keyring to be used in the application from the contents of a file, using the given master key.
keyring_file_path | path to the file where keyring is stored |
master_key | master key for the keyring |
create_if_needed | creates the keyring if it doesn't exist yet |
|
static |
|
noexcept |
bool mysql_harness::is_valid_conf_ident_char | ( | const char | ch | ) |
Returns true if a character given as a parameter is valid for config identifier (section, section key or option name)
bool mysql_harness::is_valid_domainname | ( | const std::string & | address | ) |
check if address is a domainname.
domainnames according to RFC 2181:
That means
are domainnames.
address | address to check |
true | address is a domainname |
false | address is not a domainname |
bool mysql_harness::is_valid_hostname | ( | const std::string & | address | ) |
check if address is a hostname.
hostname is verified according to RFC 1123.
address | name of a host |
false | hostname is invalid |
true | hostname is valid |
bool mysql_harness::is_valid_ip_address | ( | const std::string & | address | ) |
std::string mysql_harness::join | ( | Container | cont, |
const std::string & | delim | ||
) |
join elements of an container into a string separated by a delimiter.
Container MUST:
should work with:
cont | a container |
delim | delimiter |
|
staticnoexcept |
void mysql_harness::left_trim | ( | std::string & | str | ) |
Removes leading whitespaces from the string.
str | the string to be trimmed |
std::string mysql_harness::limit_lines | ( | const std::string & | str, |
const size_t | limit, | ||
const std::string & | replace_with = "" |
||
) |
Returns the input string with number of lines reduced to selected value.
str | input string |
limit | maximum number of lines of the returned string |
replace_with | string that should be used in place of the removed lines |
|
static |
std::error_code mysql_harness::make_error_code | ( | DynamicLoaderErrc | ec | ) |
make error_code from a DynamicLoaderErrc.
void mysql_harness::make_file_private | ( | const std::string & | file_name, |
const bool | read_only_for_local_service = true |
||
) |
Changes file access permissions to be accessible only by a limited set of users.
On Unix, the function sets file permission mask to 600. On Windows, all permissions to this file are removed for Everyone group, LocalService account gets read (and optionally write) access.
[in] | file_name | File name. |
[in] | read_only_for_local_service | Weather the LocalService user on Windows should get only the read access (if false will grant write access too). Not used on non-Windows. |
std::exception | Failed to change file permissions. |
|
static |
Makes a file fully accessible by the current process user and (read only or read/write depending on the second argument) for LocalService account (which is the account under which the MySQL router runs as service).
And not accessible for everyone else.
void mysql_harness::make_file_public | ( | const std::string & | file_name | ) |
Changes file access permissions to be fully accessible by all users.
On Unix, the function sets file permission mask to 777. On Windows, Everyone group is granted full access to the file.
[in] | file_name | File name. |
std::exception | Failed to change file permissions. |
void mysql_harness::make_file_readable_for_everyone | ( | const std::string & | file_name | ) |
void mysql_harness::make_file_readonly | ( | const std::string & | file_name | ) |
Changes file access permissions to be read only.
On Unix, the function sets file permission mask to 555. On Windows, all permissions to this file are read access only for Everyone group, LocalService account gets read access.
[in] | file_name | File name. |
std::exception | Failed to change file permissions. |
|
static |
stdx::expected< TCPAddress, std::error_code > mysql_harness::make_tcp_address | ( | const std::string & | endpoint | ) |
create TCPAddress from endpoint string.
|
static |
int mysql_harness::mkdir | ( | const std::string & | dir, |
perm_mode | mode, | ||
bool | recursive = false |
||
) |
Creates a directory *.
dir | name (or path) of the directory to create |
mode | permission mode for the created directory |
recursive | if true then imitate unix mkdir -p recursively creating parent directories if needed |
0 | operation succeeded |
-1 | operation failed because of wrong parameters |
> | 0 errno for failure to mkdir() system call |
int mysql_harness::mkdir_wrapper | ( | const std::string & | dir, |
perm_mode | mode | ||
) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
int mysql_harness::mysql_router_thread_create | ( | mysql_router_thread_handle * | thread, |
const mysql_router_thread_attr_t * | attr, | ||
my_start_routine | func, | ||
void * | arg | ||
) |
int mysql_harness::mysql_router_thread_join | ( | mysql_router_thread_handle * | thread, |
void ** | value_ptr | ||
) |
|
inlinestatic |
checks if thread pointed by attr is joinable
std::runtime_error | if cannot check if thread is joinable |
|
inlinestatic |
checks if thread pointed by thread was started
|
static |
|
static |
bool mysql_harness::notify_ready | ( | ) |
bool mysql_harness::notify_status | ( | const std::string & | msg | ) |
bool mysql_harness::notify_stopping | ( | ) |
void mysql_harness::on_service_ready | ( | const std::string & | name | ) |
void mysql_harness::on_service_ready | ( | PluginFuncEnv * | plugin_env | ) |
std::ostream & mysql_harness::operator<< | ( | std::ostream & | out, |
Path::FileType | type | ||
) |
double mysql_harness::option_as_double | ( | const std::string & | value, |
const std::string & | option_desc, | ||
double | min_value = 0 , |
||
double | max_value = std::numeric_limits<double>::max() |
||
) |
T mysql_harness::option_as_int | ( | const std::string_view & | value, |
const std::string & | option_desc, | ||
T | min_value = std::numeric_limits<T>::min() , |
||
T | max_value = std::numeric_limits<T>::max() |
||
) |
Gets an integer using the given option value.
Gets an integer using the given option value. The type can be any integer type such as uint16_t, int8_t and bool.
The min_value argument can be used to set a minimum value for the option. For example, when 0 (zero) is not allowed, min_value can be set to 1. The maximum value is whatever the maximum of the use type is.
Throws std::invalid_argument on errors.
value | Option value |
option_desc | Option name |
min_value | Minimum value |
max_value | Maximum value |
T mysql_harness::option_as_uint | ( | const std::string_view & | value, |
const std::string & | option_desc, | ||
T | min_value = std::numeric_limits<T>::min() , |
||
T | max_value = std::numeric_limits<T>::max() |
||
) |
Get a unsigned integer.
use option_as_int<T> instead.
|
static |
|
static |
|
noexcept |
Clears the keyring singleton.
void mysql_harness::right_trim | ( | std::string & | str | ) |
Removes trailing whitespaces from the string.
str | the string to be trimmed |
|
static |
std::string mysql_harness::serial_comma | ( | InputIt | start, |
InputIt | finish, | ||
const std::string & | delim = "and" |
||
) |
Returns string containing list of the elements using the serial comma.
This function can be used to output a range of elements using a serial comma (also known as the Oxford comma). To return a list of the first five prime numbers as "The first five prime numbers are 2, 3, 5, 7, and 11":
start | Input iterator to start of range. |
finish | Input iterator to one-after-end of range. |
delim | Delimiter to use. Defaults to "and". |
void mysql_harness::serial_comma | ( | std::ostream & | out, |
InputIt | start, | ||
InputIt | finish, | ||
const std::string & | delim = "and" |
||
) |
Emit a range of elements using the serial comma.
This function can be used to output a range of elements using a serial comma (also known as the Oxford comma). To emit a list of the first five prime numbers as "The first five prime numbers are 2, 3, 5, 7, and 11":
out | Output stream |
start | Input iterator to start of range. |
finish | Input iterator to one-after-end of range. |
delim | Delimiter to use. Defaults to "and". |
|
noexcept |
|
static |
Sets file permissions for Everyone group.
[in] | file_name | File name. |
[in] | mask | Access rights mask for Everyone group. |
std::exception | Failed to change file permissions. |
|
static |
std::vector< std::string > mysql_harness::split_string | ( | const std::string_view & | data, |
const char | delimiter, | ||
bool | allow_empty = true |
||
) |
Splits a string using a delimiter.
Splits a string using the given delimiter. When allow_empty is true (default), tokens can be empty, and will be included as empty in the result.
data | a string to split |
delimiter | a char used as delimiter |
allow_empty | whether to allow empty tokens or not (default true) |
|
constexpr |
std::string mysql_harness::to_string | ( | const ShutdownPending::Reason & | reason | ) |
void mysql_harness::trim | ( | std::string & | str | ) |
Removes both leading and trailing whitespaces from the string.
str | the string to be trimmed |
std::string mysql_harness::truncate_string | ( | const std::string & | str, |
size_t | max_len = 80 |
||
) |
Return a truncated version of input string.
str | input text |
max_len | maximum length after truncation |
T mysql_harness::value_or | ( | T | a, |
T | b | ||
) |
If a isn't set, return b.
like ?:, but ensures that b is always evaluated first.
|
static |
|
noexcept |
|
static |
|
static |
|
static |
|
staticconstexpr |
|
static |
|
constexpr |
|
static |
|
static |
|
static |
const perm_mode mysql_harness::kStrictDirectoryPerm = S_IRWXU |
|
constexpr |
|
constexpr |
maximum number of parameters that can be passed to the launched process
|
staticconstexpr |
|
staticconstexpr |