MySQL 9.2.0
Source Code Documentation
routing_guidelines Namespace Reference

Namespaces

namespace  anonymous_namespace{routing_guidelines.cc}
 
namespace  anonymous_namespace{rules_parser.cc}
 
namespace  rpn
 

Classes

struct  Exp_info
 
class  Guidelines_parse_error
 
struct  Resolve_host
 Information about hostnames that needs to be resolved. More...
 
struct  Router_info
 Information about this Router instance. More...
 
class  Routing_guidelines_document_parser
 
class  Routing_guidelines_engine
 Routing guidelines engine. More...
 
class  Routing_simulator
 
class  Rules_parser
 Conducting the whole scanning and parsing of routing guidelines rules. More...
 
struct  Server_info
 Information about one server destination. More...
 
struct  Session_info
 Information about incoming session. More...
 
struct  Sql_info
 Information about query details. More...
 

Typedefs

using List_info = std::vector< Exp_info >
 

Enumerations

enum class  routing_guidelines_errc { empty_routing_guidelines , not_supported_in_md , unsupported_version , parse_error }
 

Functions

const std::error_category & routing_guidelines_category () noexcept
 
std::error_code make_error_code (routing_guidelines_errc e) noexcept
 
bool is_member_role (const std::string &s)
 
bool is_cluster_role (const std::string &s)
 
std::string str_strip (const std::string &s, const std::string &chars)
 
std::string format_json_error (const std::string &s, const rapidjson::ParseResult &ok, size_t chars)
 Format JSON parse error adding responsible JSON part. More...
 
std::string mysql_unescape_string (std::string_view s)
 process escapes in a string , keep synchronous with sql_load unescape ("ntrb0ZN") More...
 
std::string like_to_regexp (std::string_view pattern)
 
int get_protocol_family (const std::string &address)
 Provides the protocol family for the given literal address. More...
 
bool is_ipv4 (const std::string &address)
 
bool is_ipv6 (const std::string &host)
 
std::string network (const std::string &address, unsigned int bitlen)
 Compute network part of an IPv4 address. More...
 
bool json_document_complete (const std::string &s)
 Is JSON document held by the string complete or not. More...
 
bool str_eq (std::string_view a, std::string_view b)
 
bool str_caseeq (const char *a, const char *b)
 
bool str_caseeq (const char *a, const char *b, size_t n)
 
bool str_caseeq (std::string_view lhs, std::string_view rhs)
 
int str_casecmp (const char *a, const char *b)
 Compares 2 strings case insensitive (for ascii) More...
 
int str_casecmp (const std::string &a, const std::string &b)
 
bool str_ibeginswith (std::string_view str, std::string_view prefix)
 
bool str_beginswith (std::string_view str, std::string_view prefix)
 
std::string str_upper (std::string_view s)
 Convert a copy of an ASCII string to uppercase and return. More...
 
std::string str_lower (std::string_view s)
 Convert a copy of an ASCII string to lowercase and return. More...
 
template<typename Container >
bool case_contains (const Container &container, std::string_view str)
 Check if container contains identincal string independent of case. More...
 

Variables

constexpr char kUndefinedRole [] = "UNDEFINED"
 Keyword meaning that the member/cluster role is undefined. More...
 
const std::array< std::string_view, 4 > k_member_roles
 
const std::array< std::string_view, 3 > k_cluster_roles
 
const std::array< std::string_view, 2 > k_routing_strategies
 

Typedef Documentation

◆ List_info

using routing_guidelines::List_info = typedef std::vector<Exp_info>

Enumeration Type Documentation

◆ routing_guidelines_errc

Enumerator
empty_routing_guidelines 
not_supported_in_md 
unsupported_version 
parse_error 

Function Documentation

◆ case_contains()

template<typename Container >
bool routing_guidelines::case_contains ( const Container &  container,
std::string_view  str 
)

Check if container contains identincal string independent of case.

◆ format_json_error()

std::string routing_guidelines::format_json_error ( const std::string &  s,
const rapidjson::ParseResult &  ok,
size_t  chars 
)

Format JSON parse error adding responsible JSON part.

Parameters
sparsed JSON
okparse result
charshow big surrounding of erroneous part to attach

◆ get_protocol_family()

int routing_guidelines::get_protocol_family ( const std::string &  address)

Provides the protocol family for the given literal address.

Parameters
addressThe address to be checked.
Returns
AF_INET if address is an IPv4 address, AF_INET6 if it's IPv6, AF_UNSPEC in case of failure.

◆ is_cluster_role()

bool routing_guidelines::is_cluster_role ( const std::string &  s)

◆ is_ipv4()

bool routing_guidelines::is_ipv4 ( const std::string &  address)

◆ is_ipv6()

bool routing_guidelines::is_ipv6 ( const std::string &  host)

◆ is_member_role()

bool routing_guidelines::is_member_role ( const std::string &  s)

◆ json_document_complete()

bool routing_guidelines::json_document_complete ( const std::string &  s)

Is JSON document held by the string complete or not.

◆ like_to_regexp()

std::string routing_guidelines::like_to_regexp ( std::string_view  pattern)

◆ make_error_code()

std::error_code routing_guidelines::make_error_code ( routing_guidelines_errc  e)
inlinenoexcept

◆ mysql_unescape_string()

std::string routing_guidelines::mysql_unescape_string ( std::string_view  s)

process escapes in a string , keep synchronous with sql_load unescape ("ntrb0ZN")

◆ network()

std::string routing_guidelines::network ( const std::string &  address,
unsigned int  bitlen 
)

Compute network part of an IPv4 address.

◆ routing_guidelines_category()

const std::error_category & routing_guidelines::routing_guidelines_category ( )
inlinenoexcept

◆ str_beginswith()

bool routing_guidelines::str_beginswith ( std::string_view  str,
std::string_view  prefix 
)
inline

◆ str_casecmp() [1/2]

int routing_guidelines::str_casecmp ( const char *  a,
const char *  b 
)
inline

Compares 2 strings case insensitive (for ascii)

◆ str_casecmp() [2/2]

int routing_guidelines::str_casecmp ( const std::string &  a,
const std::string &  b 
)
inline

◆ str_caseeq() [1/3]

bool routing_guidelines::str_caseeq ( const char *  a,
const char *  b 
)
inline

◆ str_caseeq() [2/3]

bool routing_guidelines::str_caseeq ( const char *  a,
const char *  b,
size_t  n 
)
inline

◆ str_caseeq() [3/3]

bool routing_guidelines::str_caseeq ( std::string_view  lhs,
std::string_view  rhs 
)
inline

◆ str_eq()

bool routing_guidelines::str_eq ( std::string_view  a,
std::string_view  b 
)
inline

◆ str_ibeginswith()

bool routing_guidelines::str_ibeginswith ( std::string_view  str,
std::string_view  prefix 
)
inline

◆ str_lower()

std::string routing_guidelines::str_lower ( std::string_view  s)
inline

Convert a copy of an ASCII string to lowercase and return.

◆ str_strip()

std::string routing_guidelines::str_strip ( const std::string &  s,
const std::string &  chars 
)

◆ str_upper()

std::string routing_guidelines::str_upper ( std::string_view  s)
inline

Convert a copy of an ASCII string to uppercase and return.

Variable Documentation

◆ k_cluster_roles

const std::array<std::string_view, 3> routing_guidelines::k_cluster_roles
Initial value:
{kUndefinedRole, "PRIMARY",
"REPLICA"}
constexpr char kUndefinedRole[]
Keyword meaning that the member/cluster role is undefined.
Definition: routing_guidelines.h:54

◆ k_member_roles

const std::array<std::string_view, 4> routing_guidelines::k_member_roles
Initial value:
{
kUndefinedRole, "PRIMARY", "SECONDARY", "READ_REPLICA"}

◆ k_routing_strategies

const std::array<std::string_view, 2> routing_guidelines::k_routing_strategies
Initial value:
{"round-robin",
"first-available"}

◆ kUndefinedRole

constexpr char routing_guidelines::kUndefinedRole[] = "UNDEFINED"
constexpr

Keyword meaning that the member/cluster role is undefined.