MySQL 8.4.2
Source Code Documentation
MySQLRoutingContext Class Reference

MySQLRoutingContext holds data used by MySQLRouting (1 per plugin instances) and MySQLRoutingConnection instances (many instances). More...

#include <context.h>

Public Member Functions

 MySQLRoutingContext (const RoutingConfig &routing_config, std::string name, TlsServerContext *client_ssl_ctx, DestinationTlsContext *dest_tls_context)
 
BlockedEndpointsblocked_endpoints ()
 
const BlockedEndpointsblocked_endpoints () const
 
void increase_info_active_routes ()
 
void decrease_info_active_routes ()
 
void increase_info_handled_routes ()
 
uint16_t get_active_routes ()
 
uint64_t get_handled_routes ()
 
uint64_t get_max_connect_errors () const
 
BaseProtocol::Type get_protocol ()
 
const std::string & get_name () const
 
std::string get_id () const
 identifier part of the name. More...
 
unsigned int get_net_buffer_length () const
 
std::chrono::milliseconds get_destination_connect_timeout () const
 
std::chrono::milliseconds get_client_connect_timeout () const
 
std::chrono::milliseconds connect_retry_timeout () const
 
const mysql_harness::TCPAddressget_bind_address () const
 
const mysql_harness::Pathget_bind_named_socket () const
 
SslMode source_ssl_mode () const noexcept
 
SslMode dest_ssl_mode () const noexcept
 
TlsServerContextsource_ssl_ctx () const
 get the SSL context for the client side of the route. More...
 
TlsClientContextdest_ssl_ctx (const std::string &dest_id, const std::string &hostname)
 get the SSL context for the server side of the route. More...
 
SharedQuarantineHandlershared_quarantine ()
 
const SharedQuarantineHandlershared_quarantine () const
 
bool connection_sharing () const
 
std::chrono::milliseconds connection_sharing_delay () const
 
routing::AccessMode access_mode () const
 
bool wait_for_my_writes () const
 
std::chrono::seconds wait_for_my_writes_timeout () const
 
std::string dest_ssl_key () const
 
std::string dest_ssl_cert () const
 
bool router_require_enforce () const
 

Public Attributes

std::atomic< uint16_t > info_active_routes_ {0}
 Number of active routes. More...
 
std::atomic< uint64_t > info_handled_routes_ {0}
 Number of handled routes, not used at the moment. More...
 

Private Attributes

const RoutingConfig routing_config_
 
const std::string name_
 Descriptive name of the connection routing. More...
 
std::mutex mutex_conn_errors_
 
size_t thread_stack_size_ = mysql_harness::kDefaultStackSizeInKiloBytes
 memory in kilobytes allocated for thread's stack More...
 
TlsServerContextclient_ssl_ctx_ {}
 
DestinationTlsContextdestination_tls_context_ {}
 
SharedQuarantineHandler shared_quarantine_handler_
 Callbacks for communicating with quarantined destination candidates instance. More...
 
BlockedEndpoints blocked_endpoints_
 

Detailed Description

MySQLRoutingContext holds data used by MySQLRouting (1 per plugin instances) and MySQLRoutingConnection instances (many instances).

It is created and owned by MySQLRouting while MySQLRoutingConnection objects hold reference to it.

Constructor & Destructor Documentation

◆ MySQLRoutingContext()

MySQLRoutingContext::MySQLRoutingContext ( const RoutingConfig routing_config,
std::string  name,
TlsServerContext client_ssl_ctx,
DestinationTlsContext dest_tls_context 
)
inline

Member Function Documentation

◆ access_mode()

routing::AccessMode MySQLRoutingContext::access_mode ( ) const
inline

◆ blocked_endpoints() [1/2]

BlockedEndpoints & MySQLRoutingContext::blocked_endpoints ( )
inline

◆ blocked_endpoints() [2/2]

const BlockedEndpoints & MySQLRoutingContext::blocked_endpoints ( ) const
inline

◆ connect_retry_timeout()

std::chrono::milliseconds MySQLRoutingContext::connect_retry_timeout ( ) const
inline

◆ connection_sharing()

bool MySQLRoutingContext::connection_sharing ( ) const
inline

◆ connection_sharing_delay()

std::chrono::milliseconds MySQLRoutingContext::connection_sharing_delay ( ) const
inline

◆ decrease_info_active_routes()

void MySQLRoutingContext::decrease_info_active_routes ( )

◆ dest_ssl_cert()

std::string MySQLRoutingContext::dest_ssl_cert ( ) const
inline

◆ dest_ssl_ctx()

TlsClientContext * MySQLRoutingContext::dest_ssl_ctx ( const std::string &  dest_id,
const std::string &  hostname 
)
inline

get the SSL context for the server side of the route.

Parameters
dest_idunique id of the destination
hostnamename of the destination host
Returns
a TlsClientContext for the destination.
Return values
nullptrif creating tls-context failed.

◆ dest_ssl_key()

std::string MySQLRoutingContext::dest_ssl_key ( ) const
inline

◆ dest_ssl_mode()

SslMode MySQLRoutingContext::dest_ssl_mode ( ) const
inlinenoexcept

◆ get_active_routes()

uint16_t MySQLRoutingContext::get_active_routes ( )
inline

◆ get_bind_address()

const mysql_harness::TCPAddress & MySQLRoutingContext::get_bind_address ( ) const
inline

◆ get_bind_named_socket()

const mysql_harness::Path & MySQLRoutingContext::get_bind_named_socket ( ) const
inline

◆ get_client_connect_timeout()

std::chrono::milliseconds MySQLRoutingContext::get_client_connect_timeout ( ) const
inline

◆ get_destination_connect_timeout()

std::chrono::milliseconds MySQLRoutingContext::get_destination_connect_timeout ( ) const
inline

◆ get_handled_routes()

uint64_t MySQLRoutingContext::get_handled_routes ( )
inline

◆ get_id()

std::string MySQLRoutingContext::get_id ( ) const
inline

identifier part of the name.

name has the form 'routing:{id}'

◆ get_max_connect_errors()

uint64_t MySQLRoutingContext::get_max_connect_errors ( ) const
inline

◆ get_name()

const std::string & MySQLRoutingContext::get_name ( ) const
inline

◆ get_net_buffer_length()

unsigned int MySQLRoutingContext::get_net_buffer_length ( ) const
inline

◆ get_protocol()

BaseProtocol::Type MySQLRoutingContext::get_protocol ( )
inline

◆ increase_info_active_routes()

void MySQLRoutingContext::increase_info_active_routes ( )

◆ increase_info_handled_routes()

void MySQLRoutingContext::increase_info_handled_routes ( )

◆ router_require_enforce()

bool MySQLRoutingContext::router_require_enforce ( ) const
inline

◆ shared_quarantine() [1/2]

SharedQuarantineHandler & MySQLRoutingContext::shared_quarantine ( )
inline

◆ shared_quarantine() [2/2]

const SharedQuarantineHandler & MySQLRoutingContext::shared_quarantine ( ) const
inline

◆ source_ssl_ctx()

TlsServerContext * MySQLRoutingContext::source_ssl_ctx ( ) const
inline

get the SSL context for the client side of the route.

◆ source_ssl_mode()

SslMode MySQLRoutingContext::source_ssl_mode ( ) const
inlinenoexcept

◆ wait_for_my_writes()

bool MySQLRoutingContext::wait_for_my_writes ( ) const
inline

◆ wait_for_my_writes_timeout()

std::chrono::seconds MySQLRoutingContext::wait_for_my_writes_timeout ( ) const
inline

Member Data Documentation

◆ blocked_endpoints_

BlockedEndpoints MySQLRoutingContext::blocked_endpoints_
private

◆ client_ssl_ctx_

TlsServerContext* MySQLRoutingContext::client_ssl_ctx_ {}
private

◆ destination_tls_context_

DestinationTlsContext* MySQLRoutingContext::destination_tls_context_ {}
private

◆ info_active_routes_

std::atomic<uint16_t> MySQLRoutingContext::info_active_routes_ {0}

Number of active routes.

◆ info_handled_routes_

std::atomic<uint64_t> MySQLRoutingContext::info_handled_routes_ {0}

Number of handled routes, not used at the moment.

◆ mutex_conn_errors_

std::mutex MySQLRoutingContext::mutex_conn_errors_
mutableprivate

◆ name_

const std::string MySQLRoutingContext::name_
private

Descriptive name of the connection routing.

◆ routing_config_

const RoutingConfig MySQLRoutingContext::routing_config_
private

◆ shared_quarantine_handler_

SharedQuarantineHandler MySQLRoutingContext::shared_quarantine_handler_
private

Callbacks for communicating with quarantined destination candidates instance.

◆ thread_stack_size_

size_t MySQLRoutingContext::thread_stack_size_ = mysql_harness::kDefaultStackSizeInKiloBytes
private

memory in kilobytes allocated for thread's stack


The documentation for this class was generated from the following files: