MySQL 8.0.40
Source Code Documentation
cluster_metadata.cc File Reference
#include "cluster_metadata.h"
#include <algorithm>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stdexcept>
#include <vector>
#include <errmsg.h>
#include <mysql.h>
#include "dim.h"
#include "group_replication_metadata.h"
#include "mysql/harness/event_state_tracker.h"
#include "mysql/harness/logging/logging.h"
#include "mysql/harness/utility/string.h"
#include "mysqld_error.h"
#include "mysqlrouter/mysql_session.h"
#include "mysqlrouter/uri.h"
#include "mysqlrouter/utils.h"
#include "mysqlrouter/utils_sqlstring.h"
#include "router_config.h"
#include "tcp_address.h"

Classes

struct  LogSuppressor
 
struct  LogSuppressor::instance_warnings
 

Functions

std::string as_string (const char *input_str)
 Return a string representation of the input character string. More...
 
bool set_instance_ports (metadata_cache::ManagedInstance &instance, const mysqlrouter::MySQLSession::Row &row, const size_t classic_port_column, const size_t x_port_column)
 
static std::string get_limit_target_cluster_clause (const mysqlrouter::TargetCluster &target_cluster, const mysqlrouter::ClusterType &cluster_type, mysqlrouter::MySQLSession &session)
 
static bool get_bool_tag (const std::string_view &attributes, const std::string_view &name, bool default_value, std::string &out_warning)
 Returns value fo the bool tag set in the attributes. More...
 
bool get_hidden (const std::string &attributes, std::string &out_warning)
 
bool get_disconnect_existing_sessions_when_hidden (const std::string &attributes, std::string &out_warning)
 
void set_instance_attributes (metadata_cache::ManagedInstance &instance, const std::string &attributes)
 

Function Documentation

◆ as_string()

std::string as_string ( const char *  input_str)

Return a string representation of the input character string.

Parameters
input_strA character string.
Returns
A string object encapsulation of the input character string. An empty string if input string is nullptr.

◆ get_bool_tag()

static bool get_bool_tag ( const std::string_view &  attributes,
const std::string_view &  name,
bool  default_value,
std::string &  out_warning 
)
static

Returns value fo the bool tag set in the attributes.

Parameters
attributesstring containing JSON with the attributes
namename of the tag to be fetched
default_valuevalue to be returned if the given tag is missing or invalid or if the JSON string is invalid
[out]out_warningoutput parameter where the function sets the descriptive warning in case there was a JSON parsing error
Note
the function always sets out_warning to "" at the beginning
Returns
value of the bool tag

◆ get_disconnect_existing_sessions_when_hidden()

bool get_disconnect_existing_sessions_when_hidden ( const std::string &  attributes,
std::string &  out_warning 
)

◆ get_hidden()

bool get_hidden ( const std::string &  attributes,
std::string &  out_warning 
)

◆ get_limit_target_cluster_clause()

static std::string get_limit_target_cluster_clause ( const mysqlrouter::TargetCluster target_cluster,
const mysqlrouter::ClusterType cluster_type,
mysqlrouter::MySQLSession session 
)
static

◆ set_instance_attributes()

void set_instance_attributes ( metadata_cache::ManagedInstance instance,
const std::string &  attributes 
)

◆ set_instance_ports()

bool set_instance_ports ( metadata_cache::ManagedInstance instance,
const mysqlrouter::MySQLSession::Row row,
const size_t  classic_port_column,
const size_t  x_port_column 
)