MySQL 8.0.39
Source Code Documentation
Gcs_mysql_network_provider Class Reference

Implementation of a. More...

#include <gcs_mysql_network_provider.h>

Inheritance diagram for Gcs_mysql_network_provider:
[legend]

Public Member Functions

 Gcs_mysql_network_provider (Gcs_mysql_network_provider_auth_interface *auth_provider, Gcs_mysql_network_provider_native_interface *native_interface)
 Construct a new Gcs_mysql_network_provider. More...
 
virtual ~Gcs_mysql_network_provider () override
 
std::pair< bool, int > start () override
 See. More...
 
std::pair< bool, int > stop () override
 See. More...
 
enum_transport_protocol get_communication_stack () const override
 Get the communication stack implemented by this class. More...
 
bool configure (const Network_configuration_parameters &params) override
 See. More...
 
bool configure_secure_connections (const Network_configuration_parameters &params) override
 See. More...
 
void cleanup_secure_connections_context () override
 
bool finalize_secure_connections_context () override
 
std::unique_ptr< Network_connectionopen_connection (const std::string &address, const unsigned short port, const Network_security_credentials &security_credentials, int connection_timeout=Network_provider::default_connection_timeout(), network_provider_dynamic_log_level log_level=network_provider_dynamic_log_level::PROVIDED) override
 See. More...
 
int close_connection (const Network_connection &connection) override
 Closes an open connection to another XCom endpoint served by the same Network provider. More...
 
void set_new_connection (THD *thd, Network_connection *connection)
 Set the new connection coming form MySQL server. More...
 
- Public Member Functions inherited from Network_provider
 Network_provider ()
 
 Network_provider (Network_provider &&param)
 
Network_provideroperator= (Network_provider &param)=delete
 
 Network_provider (Network_provider &param)=delete
 
virtual ~Network_provider ()
 
virtual std::function< void()> get_secure_connections_context_cleaner ()
 
void set_new_connection (Network_connection *connection)
 Lock-free Set connection. More...
 
Network_connectionget_new_connection ()
 Get the new connection object. More...
 
void reset_new_connection ()
 

Private Attributes

std::map< int, MYSQL * > m_connection_map
 A map that holds all open MySQL client connections. More...
 
std::map< int, THD * > m_incoming_connection_map
 A map that holds THD's for all open MySQL Server connections. More...
 
mysql_mutex_t m_GR_LOCK_connection_map_mutex
 
Network_configuration_parameters m_config_parameters
 
Gcs_mysql_network_provider_auth_interfacem_auth_provider
 External IoC dependencies. More...
 
Gcs_mysql_network_provider_native_interfacem_native_interface
 

Additional Inherited Members

- Static Public Member Functions inherited from Network_provider
static constexpr int default_connection_timeout ()
 

Detailed Description

Implementation of a.

See also
Network_provider that will manage MySQL protocol connection for GCS/XCOM.

Constructor & Destructor Documentation

◆ Gcs_mysql_network_provider()

Gcs_mysql_network_provider::Gcs_mysql_network_provider ( Gcs_mysql_network_provider_auth_interface auth_provider,
Gcs_mysql_network_provider_native_interface native_interface 
)
inline

Construct a new Gcs_mysql_network_provider.

Parameters
auth_providerA provider interface implementation for authentication parameters.
native_interfaceA provider interface for all mysql native methods.

◆ ~Gcs_mysql_network_provider()

virtual Gcs_mysql_network_provider::~Gcs_mysql_network_provider ( )
inlineoverridevirtual

Member Function Documentation

◆ cleanup_secure_connections_context()

void Gcs_mysql_network_provider::cleanup_secure_connections_context ( )
overridevirtual

Implements Network_provider.

◆ close_connection()

int Gcs_mysql_network_provider::close_connection ( const Network_connection connection)
overridevirtual

Closes an open connection to another XCom endpoint served by the same Network provider.

Parameters
connectionan open and valid connection
Returns
int an error code in case of error. 0, otherwise.

Implements Network_provider.

◆ configure()

bool Gcs_mysql_network_provider::configure ( const Network_configuration_parameters params)
overridevirtual

See.

See also
Network_provider::configure

Implements Network_provider.

◆ configure_secure_connections()

bool Gcs_mysql_network_provider::configure_secure_connections ( const Network_configuration_parameters params)
overridevirtual

See.

See also
Network_provider::configure_secure_connections

Implements Network_provider.

◆ finalize_secure_connections_context()

bool Gcs_mysql_network_provider::finalize_secure_connections_context ( )
overridevirtual

Implements Network_provider.

◆ get_communication_stack()

enum_transport_protocol Gcs_mysql_network_provider::get_communication_stack ( ) const
inlineoverridevirtual

Get the communication stack implemented by this class.

Returns
a CommunicationStack enum value. In this case -> MYSQL_PROTOCOL

Implements Network_provider.

◆ open_connection()

std::unique_ptr< Network_connection > Gcs_mysql_network_provider::open_connection ( const std::string &  address,
const unsigned short  port,
const Network_security_credentials security_credentials,
int  connection_timeout = Network_provider::default_connection_timeout(),
network_provider_dynamic_log_level  log_level = network_provider_dynamic_log_level::PROVIDED 
)
overridevirtual

See.

See also
Network_provider::open_connection

Implements Network_provider.

◆ set_new_connection()

void Gcs_mysql_network_provider::set_new_connection ( THD thd,
Network_connection connection 
)

Set the new connection coming form MySQL server.

Parameters
thdthe THD to which the connection belongs to.
connectionthe connection data itself.

◆ start()

std::pair< bool, int > Gcs_mysql_network_provider::start ( )
overridevirtual

See.

See also
Network_provider::start

Implements Network_provider.

◆ stop()

std::pair< bool, int > Gcs_mysql_network_provider::stop ( )
overridevirtual

See.

See also
Network_provider::stop

Implements Network_provider.

Member Data Documentation

◆ m_auth_provider

Gcs_mysql_network_provider_auth_interface* Gcs_mysql_network_provider::m_auth_provider
private

External IoC dependencies.

  • A provider for authentication parameters
  • A provider for all mysql native methods

◆ m_config_parameters

Network_configuration_parameters Gcs_mysql_network_provider::m_config_parameters
private

◆ m_connection_map

std::map<int, MYSQL *> Gcs_mysql_network_provider::m_connection_map
private

A map that holds all open MySQL client connections.

Since the public interface of Network Managers only knows about File Descriptors, this is the repository for all MySQL client connections. This object is required when using mysql_close.

The map's index is the open connection's file descriptor.

◆ m_GR_LOCK_connection_map_mutex

mysql_mutex_t Gcs_mysql_network_provider::m_GR_LOCK_connection_map_mutex
private

◆ m_incoming_connection_map

std::map<int, THD *> Gcs_mysql_network_provider::m_incoming_connection_map
private

A map that holds THD's for all open MySQL Server connections.

We need to maintain this reference in order to call the appropriate closing mechanisms when destroying an incoming connection.

The map's index is the open connection's file descriptor.

◆ m_native_interface

Gcs_mysql_network_provider_native_interface* Gcs_mysql_network_provider::m_native_interface
private

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