MySQL 8.0.40
Source Code Documentation
Gcs_xcom_proxy_base Class Reference

#include <gcs_xcom_proxy.h>

Inheritance diagram for Gcs_xcom_proxy_base:
[legend]

Public Member Functions

 Gcs_xcom_proxy_base ()=default
 
 ~Gcs_xcom_proxy_base () override=default
 
bool xcom_boot_node (Gcs_xcom_node_information &node, uint32_t group_id_hash) override
 Function used to boot a node in XCOM. More...
 
bool xcom_remove_nodes (Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override
 Function to remove a set of nodes from XCOM. More...
 
bool xcom_remove_nodes (connection_descriptor &con, Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override
 Function to remove a set of nodes from XCOM. More...
 
bool xcom_remove_node (const Gcs_xcom_node_information &node, uint32_t group_id_hash) override
 Function to remove a node from XCOM. More...
 
bool xcom_add_nodes (connection_descriptor &con, Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override
 Function to add a set of nodes to XCOM. More...
 
bool xcom_add_node (connection_descriptor &con, const Gcs_xcom_node_information &node, uint32_t group_id_hash) override
 Function to add a node to XCOM. More...
 
xcom_event_horizon xcom_get_minimum_event_horizon () override
 Function to retrieve XCOM's minimum supported event horizon value. More...
 
xcom_event_horizon xcom_get_maximum_event_horizon () override
 Function to retrieve XCOM's maximum supported event horizon value. More...
 
bool xcom_get_event_horizon (uint32_t group_id_hash, xcom_event_horizon &event_horizon) override
 Function to retrieve XCOM's event horizon. More...
 
bool xcom_set_event_horizon (uint32_t group_id_hash, xcom_event_horizon event_horizon) override
 Function to reconfigure XCOM's event horizon. More...
 
bool xcom_set_leaders (uint32_t group_id_hash, u_int nr_preferred_leaders, char const *preferred_leaders[], node_no max_nr_leaders) override
 
bool xcom_get_leaders (uint32_t group_id_hash, leader_info_data &leaders) override
 
bool xcom_get_synode_app_data (Gcs_xcom_node_information const &xcom_instance, uint32_t group_id_hash, const std::unordered_set< Gcs_xcom_synode > &synode_set, synode_app_data_array &reply) override
 Function to retrieve the application payloads decided on a set of synodes. More...
 
bool xcom_set_cache_size (uint64_t size) override
 Function to reconfigure the maximum size of the XCom cache. More...
 
bool xcom_force_nodes (Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override
 
bool initialize_network_manager () override
 Initializes XCom's Network Manager. More...
 
bool finalize_network_manager () override
 Finalizes XCom's Network Manager. More...
 
bool set_network_manager_active_provider (enum_transport_protocol new_value) override
 Set XCom's network manager active provider. More...
 
- Public Member Functions inherited from Gcs_xcom_proxy
 Gcs_xcom_proxy ()=default
 
virtual ~Gcs_xcom_proxy ()=default
 The destructor. More...
 
virtual node_address * new_node_address_uuid (unsigned int n, char const *names[], blob uuids[])=0
 This is an utility member function that is used to call into XCom for creating list with node's addresses and their associated UUIDs. More...
 
virtual void delete_node_address (unsigned int n, node_address *na)=0
 This function is responsible to delete the list of nodes that had been previously created by new_node_address. More...
 
virtual bool xcom_client_add_node (connection_descriptor *fd, node_list *nl, uint32_t group_id)=0
 This member function is responsible to call into XCom consensus and add a node to the group. More...
 
virtual bool xcom_client_remove_node (node_list *nl, uint32_t group_id)=0
 This member function is responsible for triggering the removal of a node from the XCom configuration. More...
 
virtual bool xcom_client_remove_node (connection_descriptor *fd, node_list *nl, uint32_t group_id)=0
 This member function is responsible for triggering the removal of a node from the XCom configuration. More...
 
virtual bool xcom_client_get_event_horizon (uint32_t group_id, xcom_event_horizon &event_horizon)=0
 This member function is responsible for retrieving the event horizon of the XCom configuration. More...
 
virtual bool xcom_client_set_event_horizon (uint32_t group_id, xcom_event_horizon event_horizon)=0
 This member function is responsible for triggering the reconfiguration of the event horizon of the XCom configuration. More...
 
virtual bool xcom_client_set_leaders (uint32_t group_id, u_int nr_preferred_leaders, char const *preferred_leaders[], node_no max_nr_leaders)=0
 This member function is responsible for triggering the reconfiguration of the leaders of the XCom configuration. More...
 
virtual bool xcom_client_get_leaders (uint32_t group_id, leader_info_data &leaders)=0
 This member function is responsible for retrieving the leaders of the XCom configuration. More...
 
virtual bool xcom_client_get_synode_app_data (connection_descriptor *fd, uint32_t group_id, synode_no_array &synodes, synode_app_data_array &reply)=0
 This member function is responsible for retrieving the application payloads decided in the synodes in synodes, from the XCom instance connected to via fd. More...
 
virtual bool xcom_client_set_cache_size (uint64_t size)=0
 This member function is responsible for setting a new value for the maximum size of the XCom cache. More...
 
virtual bool xcom_client_send_data (unsigned long long size, char *data)=0
 This member function is responsible for pushing data into consensus on XCom. More...
 
virtual void xcom_init (xcom_port listen_port)=0
 This member function initializes XCom. More...
 
virtual void xcom_exit ()=0
 This member function finishes the XCom thread. More...
 
virtual int xcom_get_ssl_mode (const char *mode)=0
 
virtual int xcom_set_ssl_mode (int mode)=0
 
virtual int xcom_get_ssl_fips_mode (const char *mode)=0
 
virtual int xcom_set_ssl_fips_mode (int mode)=0
 
virtual bool xcom_init_ssl ()=0
 Initialize the SSL. More...
 
virtual void xcom_destroy_ssl ()=0
 
virtual bool xcom_use_ssl ()=0
 Return whether the SSL will be used to encrypt data or not. More...
 
virtual void xcom_set_ssl_parameters (ssl_parameters ssl, tls_parameters tls)=0
 
virtual site_def const * find_site_def (synode_no synode)=0
 
virtual bool xcom_client_boot (node_list *nl, uint32_t group_id)=0
 This member function boots XCom. More...
 
virtual connection_descriptorxcom_client_open_connection (std::string addr, xcom_port port)=0
 This member function opens a connection to an XCom instance. More...
 
virtual bool xcom_client_close_connection (connection_descriptor *fd)=0
 This member function closes the connection to an XCom instance. More...
 
virtual enum_gcs_error xcom_wait_ready ()=0
 This member waits for XCom to be initialized. More...
 
virtual bool xcom_is_ready ()=0
 
virtual void xcom_set_ready (bool value)=0
 
virtual void xcom_signal_ready ()=0
 
virtual void xcom_wait_for_xcom_comms_status_change (int &status)=0
 Call this method to wait for XCom communications to be initialized. More...
 
virtual bool xcom_has_comms_status_changed ()=0
 
virtual void xcom_set_comms_status (int status)=0
 
virtual void xcom_signal_comms_status_changed (int status)=0
 
virtual enum_gcs_error xcom_wait_exit ()=0
 Call this method to wait for XCom to exit. More...
 
virtual bool xcom_is_exit ()=0
 This verifies if XCom has finished or not. More...
 
virtual void xcom_set_exit (bool value)=0
 This sets whether XCom has finished or not. More...
 
virtual void xcom_set_cleanup ()=0
 Clean up variables used to notify states in the XCOM's state machine. More...
 
virtual void xcom_signal_exit ()=0
 This modifies the internal cached status and signals all threads that might be waiting on xcom_wait_exit. More...
 
virtual bool xcom_client_force_config (node_list *nl, uint32_t group_id)=0
 This method forces XCom to inject a new configuration in the group, even if it does not contain a majority of members. More...
 
virtual bool xcom_force_nodes (Gcs_xcom_nodes &nodes, unsigned int group_id_hash)=0
 Function to force the set of nodes in XCOM's configuration. More...
 
virtual bool get_should_exit ()=0
 Function that retrieves the value that signals that XCom must be forcefully stopped. More...
 
virtual void set_should_exit (bool should_exit)=0
 Function that sets the value that signals that XCom must be forcefully stopped. More...
 
virtual bool xcom_input_connect (std::string const &address, xcom_port port)=0
 Opens the input channel to XCom. More...
 
virtual void xcom_input_disconnect ()=0
 Closes the input channel to XCom. More...
 
virtual bool xcom_input_try_push (app_data_ptr data)=0
 Attempts to send the command data to XCom. More...
 
virtual Gcs_xcom_input_queue::future_reply xcom_input_try_push_and_get_reply (app_data_ptr data)=0
 Attempts to send the command data to XCom, and returns a future to XCom's reply. More...
 
virtual xcom_input_request_ptr xcom_input_try_pop ()=0
 Attempts to retrieve incoming commands. More...
 

Private Member Functions

bool serialize_nodes_information (Gcs_xcom_nodes &nodes, node_list &nl)
 
void free_nodes_information (node_list &nl)
 
bool test_xcom_tcp_connection (std::string &host, xcom_port port) override
 Performs a test connection to the given XCom instance via TCP. More...
 

Constructor & Destructor Documentation

◆ Gcs_xcom_proxy_base()

Gcs_xcom_proxy_base::Gcs_xcom_proxy_base ( )
explicitdefault

◆ ~Gcs_xcom_proxy_base()

Gcs_xcom_proxy_base::~Gcs_xcom_proxy_base ( )
overridedefault

Member Function Documentation

◆ finalize_network_manager()

bool Gcs_xcom_proxy_base::finalize_network_manager ( )
overridevirtual

Finalizes XCom's Network Manager.

This cleans up everythins regarding network.

Returns
true in case of error, false otherwise.

Implements Gcs_xcom_proxy.

◆ free_nodes_information()

void Gcs_xcom_proxy_base::free_nodes_information ( node_list &  nl)
private

◆ initialize_network_manager()

bool Gcs_xcom_proxy_base::initialize_network_manager ( )
overridevirtual

Initializes XCom's Network Manager.

This must be called to ensure that we have client connection abilities since the start of GCS.

Returns
true in case of error, false otherwise.

Implements Gcs_xcom_proxy.

◆ serialize_nodes_information()

bool Gcs_xcom_proxy_base::serialize_nodes_information ( Gcs_xcom_nodes nodes,
node_list &  nl 
)
private

◆ set_network_manager_active_provider()

bool Gcs_xcom_proxy_base::set_network_manager_active_provider ( enum_transport_protocol  new_value)
overridevirtual

Set XCom's network manager active provider.

Parameters
new_valuethe value of the Communication Stack to use.
Returns
true in case of error, false otherwise.

Implements Gcs_xcom_proxy.

◆ test_xcom_tcp_connection()

bool Gcs_xcom_proxy_base::test_xcom_tcp_connection ( std::string &  host,
xcom_port  port 
)
overrideprivatevirtual

Performs a test connection to the given XCom instance via TCP.

Parameters
hostthe XCom instance's host
portthe XCom instance's port
Returns
true if we were able to successfully connect, false otherwise.

Implements Gcs_xcom_proxy.

◆ xcom_add_node()

bool Gcs_xcom_proxy_base::xcom_add_node ( connection_descriptor con,
const Gcs_xcom_node_information node,
uint32_t  group_id_hash 
)
overridevirtual

Function to add a node to XCOM.

Parameters
conConnection to a node that will carry on the request.
nodeNode information.
group_id_hashHash of group identifier.
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of adding a node. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the node was added to the configuration.

Implements Gcs_xcom_proxy.

◆ xcom_add_nodes()

bool Gcs_xcom_proxy_base::xcom_add_nodes ( connection_descriptor con,
Gcs_xcom_nodes nodes,
uint32_t  group_id_hash 
)
overridevirtual

Function to add a set of nodes to XCOM.

Parameters
conConnection to a node that will carry on the request.
nodesSet of nodes.
group_id_hashHash of group identifier.
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of adding a node. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the nodes were added to the configuration.

Implements Gcs_xcom_proxy.

◆ xcom_boot_node()

bool Gcs_xcom_proxy_base::xcom_boot_node ( Gcs_xcom_node_information node,
uint32_t  group_id_hash 
)
overridevirtual

Function used to boot a node in XCOM.

Parameters
nodeNode information.
group_id_hashHash of group identifier.
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of booting. Since this is basically an asynchronous function, one needs to wait for XCom to signal it is ready to validate whether it booted.

Implements Gcs_xcom_proxy.

◆ xcom_force_nodes()

bool Gcs_xcom_proxy_base::xcom_force_nodes ( Gcs_xcom_nodes nodes,
uint32_t  group_id_hash 
)
override

◆ xcom_get_event_horizon()

bool Gcs_xcom_proxy_base::xcom_get_event_horizon ( uint32_t  group_id_hash,
xcom_event_horizon &  event_horizon 
)
overridevirtual

Function to retrieve XCOM's event horizon.

Parameters
[in]group_id_hashHash of group identifier.
[out]event_horizonA reference to where the group's event horizon value will be written to
Returns
true if successful, false otherwise

Implements Gcs_xcom_proxy.

◆ xcom_get_leaders()

bool Gcs_xcom_proxy_base::xcom_get_leaders ( uint32_t  group_id_hash,
leader_info_data &  leaders 
)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_get_maximum_event_horizon()

xcom_event_horizon Gcs_xcom_proxy_base::xcom_get_maximum_event_horizon ( )
overridevirtual

Function to retrieve XCOM's maximum supported event horizon value.

Implements Gcs_xcom_proxy.

◆ xcom_get_minimum_event_horizon()

xcom_event_horizon Gcs_xcom_proxy_base::xcom_get_minimum_event_horizon ( )
overridevirtual

Function to retrieve XCOM's minimum supported event horizon value.

Implements Gcs_xcom_proxy.

◆ xcom_get_synode_app_data()

bool Gcs_xcom_proxy_base::xcom_get_synode_app_data ( Gcs_xcom_node_information const &  xcom_instance,
uint32_t  group_id_hash,
const std::unordered_set< Gcs_xcom_synode > &  synode_set,
synode_app_data_array &  reply 
)
overridevirtual

Function to retrieve the application payloads decided on a set of synodes.

Parameters
[in]xcom_instanceThe XCom instance to connect to
[in]group_id_hashHash of group identifier.
[in]synode_setThe desired synodes
[out]replyWhere the requested payloads will be written to
Returns
true (false) on success (failure). Success means that XCom had the requested payloads, which were written to reply.

Implements Gcs_xcom_proxy.

◆ xcom_remove_node()

bool Gcs_xcom_proxy_base::xcom_remove_node ( const Gcs_xcom_node_information node,
uint32_t  group_id_hash 
)
overridevirtual

Function to remove a node from XCOM.

Parameters
nodeNode information.
group_id_hashHash of group identifier.
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of removing a node. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the node was removed from the configuration.

Implements Gcs_xcom_proxy.

◆ xcom_remove_nodes() [1/2]

bool Gcs_xcom_proxy_base::xcom_remove_nodes ( connection_descriptor con,
Gcs_xcom_nodes nodes,
uint32_t  group_id_hash 
)
overridevirtual

Function to remove a set of nodes from XCOM.

Parameters
conConnection to a node that will carry on the request.
nodesSet of nodes to remove.
group_id_hashHash of group identifier.
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of removing a node. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the nodes were removed from the configuration.

Implements Gcs_xcom_proxy.

◆ xcom_remove_nodes() [2/2]

bool Gcs_xcom_proxy_base::xcom_remove_nodes ( Gcs_xcom_nodes nodes,
uint32_t  group_id_hash 
)
overridevirtual

Function to remove a set of nodes from XCOM.

Parameters
nodesSet of nodes.
group_id_hashHash of group identifier.
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of removing a node. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the nodes were removed from the configuration.

Implements Gcs_xcom_proxy.

◆ xcom_set_cache_size()

bool Gcs_xcom_proxy_base::xcom_set_cache_size ( uint64_t  size)
overridevirtual

Function to reconfigure the maximum size of the XCom cache.

Parameters
sizeCache size limit.
Returns
true if the operation is successfully pushed to XCom's queue, false otherwise

Implements Gcs_xcom_proxy.

◆ xcom_set_event_horizon()

bool Gcs_xcom_proxy_base::xcom_set_event_horizon ( uint32_t  group_id_hash,
xcom_event_horizon  event_horizon 
)
overridevirtual

Function to reconfigure XCOM's event horizon.

Parameters
group_id_hashHash of group identifier.
event_horizonDesired event horizon value.
Returns
true if successful, false otherwise

Implements Gcs_xcom_proxy.

◆ xcom_set_leaders()

bool Gcs_xcom_proxy_base::xcom_set_leaders ( uint32_t  group_id_hash,
u_int  nr_preferred_leaders,
char const *  preferred_leaders[],
node_no  max_nr_leaders 
)
overridevirtual

Implements Gcs_xcom_proxy.


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