MySQL 8.4.2
Source Code Documentation
|
Implementation of the Gcs_interface for the XCom binding. More...
#include <gcs_xcom_interface.h>
Public Member Functions | |
~Gcs_xcom_interface () override | |
enum_gcs_error | initialize (const Gcs_interface_parameters &interface_params) override |
This block implements the virtual methods defined in Gcs_interface. More... | |
enum_gcs_error | configure (const Gcs_interface_parameters &interface_params) override |
Method used by a binding implementation in order to implement any type of necessary dynamic reconfiguration. More... | |
bool | is_initialized () override |
Method used to report if the binding interface has already been initialized. More... | |
enum_gcs_error | finalize () override |
Method used by a binding implementation in order to implement any internal shutdown procedure. More... | |
Gcs_control_interface * | get_control_session (const Gcs_group_identifier &group_identifier) override |
Method that retrieves the binding implementation of the Control Session interface. More... | |
Gcs_communication_interface * | get_communication_session (const Gcs_group_identifier &group_identifier) override |
Method that retrieves the binding implementation of the Communication Session interface. More... | |
Gcs_statistics_interface * | get_statistics (const Gcs_group_identifier &group_identifier) override |
Method that retrieves the binding implementation of the Statistics interface. More... | |
Gcs_group_management_interface * | get_management_session (const Gcs_group_identifier &group_identifier) override |
Method that retrieves the binding implementation of the Group Management Session interface. More... | |
enum_gcs_error | configure_message_stages (const Gcs_group_identifier &gid) |
enum_gcs_error | configure_suspicions_mgr (Gcs_interface_parameters &p, Gcs_suspicions_manager *mgr) |
enum_gcs_error | set_logger (Logger_interface *logger) override |
Method that retrieves the binding implementation of the Group Management Session interface. More... | |
void | set_xcom_group_information (const std::string &group_id) |
Gcs_group_identifier * | get_xcom_group_information (const u_long group_id) |
Gcs_xcom_node_address * | get_node_address () |
void | set_node_address (std::string const &address) |
enum_gcs_error | setup_runtime_resources (Gcs_interface_runtime_requirements &reqs) override |
enum_gcs_error | cleanup_runtime_resources (Gcs_interface_runtime_requirements &reqs) override |
const Gcs_interface_parameters & | get_initialization_parameters () |
This member function shall return the set of parameters that configure the interface at the time its initialization was done. More... | |
Gcs_ip_allowlist & | get_ip_allowlist () |
Must return the allowlist. More... | |
void | process_xcom_exit () |
void | finalize_xcom () |
Contains all the code needed to stop the xcom daemon if it was not already stopped as it should have been done. More... | |
void | make_gcs_leave_group_on_error () |
Makes GCS leave the group when an error has caused XCom to terminate unexpectedly. More... | |
void | initialize_ssl () |
Used to initialize SSL assuming that the necessary parameters have already been read. More... | |
bool | set_xcom_identity (Gcs_xcom_node_information const &node_information, Gcs_xcom_proxy &xcom_proxy) |
Used to initialize the unique identifier of the XCom instance. More... | |
Public Member Functions inherited from Gcs_interface | |
virtual | ~Gcs_interface ()=default |
Static Public Member Functions | |
static Gcs_interface * | get_interface () |
Since one wants that a single instance exists, the interface implementation shall be retrieved via a Singleton pattern. More... | |
static void | cleanup () |
Public method that finalizes and cleans the singleton. More... | |
static void | cleanup_thread_ssl_resources () |
Public method that cleans thread-local resources related to communication. More... | |
Private Member Functions | |
Gcs_xcom_interface () | |
XCom binding private constructor. More... | |
enum_gcs_error | initialize_logging (const std::string *debug_file, const std::string *debug_path) |
Method to initialize the logging and debugging systems. More... | |
enum_gcs_error | finalize_logging () |
Method to finalize the logging and debugging systems. More... | |
gcs_xcom_group_interfaces * | get_group_interfaces (const Gcs_group_identifier &group_identifier) |
Internal helper method that retrieves all group interfaces for a certain group. More... | |
bool | initialize_xcom (const Gcs_interface_parameters &interface_params) |
Contains all the code needed to initialize a connection to the xcom daemon. More... | |
void | clean_group_interfaces () |
Internal helper method to delete all previously created group interfaces. More... | |
void | clean_group_references () |
Internal helper method to delete all previously created group references. More... | |
void | initialize_peer_nodes (const std::string *peer_nodes) |
Helper used to parse the peer_nodes parameter and to initialize XCom peer nodes. More... | |
void | clear_peer_nodes () |
Helper used to delete the existing XCom peer nodes in m_xcom_peers and to clear that vector. More... | |
void | announce_finalize_to_view_control () |
Announces that a finalize was called to all group instances that use a Gcs_xcom_view_change_control_interface. More... | |
Gcs_xcom_interface (Gcs_xcom_interface const &) | |
Gcs_xcom_interface & | operator= (Gcs_xcom_interface const &) |
Static Private Attributes | |
static Gcs_interface * | interface_reference_singleton = nullptr |
Implementation of the Gcs_interface for the XCom binding.
|
explicitprivate |
XCom binding private constructor.
|
overridedefault |
|
private |
|
private |
Announces that a finalize was called to all group instances that use a Gcs_xcom_view_change_control_interface.
The purpose of this is to end any ongoing tasks, like pending joins.
|
private |
Internal helper method to delete all previously created group interfaces.
|
private |
Internal helper method to delete all previously created group references.
|
static |
Public method that finalizes and cleans the singleton.
|
overridevirtual |
Implements Gcs_interface.
|
static |
Public method that cleans thread-local resources related to communication.
Required when SSL is provided by OpenSSL.
|
private |
Helper used to delete the existing XCom peer nodes in m_xcom_peers and to clear that vector.
|
overridevirtual |
Method used by a binding implementation in order to implement any type of necessary dynamic reconfiguration.
An example of this could be an underlying GCS that needs to adjust itself to changes in a group. Note, however, that the method must be only used when the system is not running in order to avoid possible concurrency issues. Using cached information by the caller, after this member function has been called, results in undefined behavior.
GCS_OK | in case of everything goes well. Any other value of gcs_error in case of error. |
Implements Gcs_interface.
enum_gcs_error Gcs_xcom_interface::configure_message_stages | ( | const Gcs_group_identifier & | gid | ) |
enum_gcs_error Gcs_xcom_interface::configure_suspicions_mgr | ( | Gcs_interface_parameters & | p, |
Gcs_suspicions_manager * | mgr | ||
) |
|
overridevirtual |
Method used by a binding implementation in order to implement any internal shutdown procedure.
GCS_OK | in case of everything goes well. Any other value of gcs_error in case of error |
Implements Gcs_interface.
|
private |
Method to finalize the logging and debugging systems.
If something bad happens, an error is returned.
void Gcs_xcom_interface::finalize_xcom | ( | ) |
Contains all the code needed to stop the xcom daemon if it was not already stopped as it should have been done.
|
overridevirtual |
Method that retrieves the binding implementation of the Communication Session interface.
[in] | group_identifier | the group in which this implementation pertains |
Implements Gcs_interface.
|
overridevirtual |
Method that retrieves the binding implementation of the Control Session interface.
[in] | group_identifier | the group in which this implementation pertains |
Implements Gcs_interface.
|
private |
Internal helper method that retrieves all group interfaces for a certain group.
[in] | group_identifier | the group in which one wants to instantiate the interface implementation |
|
inline |
This member function shall return the set of parameters that configure the interface at the time its initialization was done.
The parameters returned already contain default values set as well as values that may have been fixed.
|
static |
Since one wants that a single instance exists, the interface implementation shall be retrieved via a Singleton pattern.
This is the public method that allows the retrieving of the single instance.
Gcs_ip_allowlist & Gcs_xcom_interface::get_ip_allowlist | ( | ) |
Must return the allowlist.
|
overridevirtual |
Method that retrieves the binding implementation of the Group Management Session interface.
[in] | group_identifier | the group in which this implementation pertains |
Implements Gcs_interface.
Gcs_xcom_node_address * Gcs_xcom_interface::get_node_address | ( | ) |
|
overridevirtual |
Method that retrieves the binding implementation of the Statistics interface.
[in] | group_identifier | the group in which this implementation pertains |
Implements Gcs_interface.
Gcs_group_identifier * Gcs_xcom_interface::get_xcom_group_information | ( | const u_long | group_id | ) |
|
overridevirtual |
This block implements the virtual methods defined in Gcs_interface.
Implements Gcs_interface.
|
private |
Method to initialize the logging and debugging systems.
If something bad happens, an error is returned.
[in] | debug_file | File where the debug information on GCS will be stored to |
[in] | debug_path | Default path where the debug information on GCS will be stored to |
|
private |
Helper used to parse the peer_nodes parameter and to initialize XCom peer nodes.
[in] | peer_nodes | received parameter with the addresses of all peer nodes |
void Gcs_xcom_interface::initialize_ssl | ( | ) |
Used to initialize SSL assuming that the necessary parameters have already been read.
|
private |
Contains all the code needed to initialize a connection to the xcom daemon.
These parameters must have been validated syntatically on the caller. Gcs_xcom_interface::initialize
.
|
overridevirtual |
Method used to report if the binding interface has already been initialized.
true | if already initialized |
Implements Gcs_interface.
void Gcs_xcom_interface::make_gcs_leave_group_on_error | ( | ) |
Makes GCS leave the group when an error has caused XCom to terminate unexpectedly.
|
private |
void Gcs_xcom_interface::process_xcom_exit | ( | ) |
|
overridevirtual |
Method that retrieves the binding implementation of the Group Management Session interface.
[in] | logger | the logger implementation for GCS to use |
GCS_OK | in case of everything goes well. Any other value of gcs_error in case of error |
Implements Gcs_interface.
void Gcs_xcom_interface::set_node_address | ( | std::string const & | address | ) |
void Gcs_xcom_interface::set_xcom_group_information | ( | const std::string & | group_id | ) |
bool Gcs_xcom_interface::set_xcom_identity | ( | Gcs_xcom_node_information const & | node_information, |
Gcs_xcom_proxy & | xcom_proxy | ||
) |
Used to initialize the unique identifier of the XCom instance.
node_information | Information about the XCom node |
xcom_proxy | XCom proxy |
true | if there was an error initialising the XCom identity |
false | if operation was successful |
|
overridevirtual |
Implements Gcs_interface.
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
The C++ interface to setup and configure xcom properties from GCS.
Under the hood, this changes the C structure that holds the configuration for XCom.
(As XCom moves into C++, we can replace XCom's internal structure with a similar object and remove it from this place.)
|
private |
|
private |
The initialization parameters provided through the initialize member function.
|
private |
The IP allowlist.
|
private |
|
private |
Network namespace service provider.
|
private |
|
private |
|
private |
Indicates whether SSL has been initialized and if that initialization was successful.
|
private |
Interface for statistic storage.
|
private |
protects the m_ssl_init_state thread shared variable
|
private |
|
private |
|
private |
|
private |
Interface for XCom statistic storage.