MySQL 8.0.40
Source Code Documentation
|
#include <gcs_xcom_proxy.h>
Public Member Functions | |
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_descriptor * | xcom_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_boot_node (Gcs_xcom_node_information &node, uint32_t group_id_hash)=0 |
Function used to boot a node in XCOM. More... | |
virtual bool | xcom_remove_nodes (Gcs_xcom_nodes &nodes, uint32_t group_id_hash)=0 |
Function to remove a set of nodes from XCOM. More... | |
virtual bool | xcom_remove_nodes (connection_descriptor &con, Gcs_xcom_nodes &nodes, uint32_t group_id_hash)=0 |
Function to remove a set of nodes from XCOM. More... | |
virtual bool | xcom_remove_node (const Gcs_xcom_node_information &node, uint32_t group_id_hash)=0 |
Function to remove a node from XCOM. More... | |
virtual bool | xcom_add_nodes (connection_descriptor &con, Gcs_xcom_nodes &nodes, uint32_t group_id_hash)=0 |
Function to add a set of nodes to XCOM. More... | |
virtual bool | xcom_add_node (connection_descriptor &con, const Gcs_xcom_node_information &node, uint32_t group_id_hash)=0 |
Function to add a node to XCOM. More... | |
virtual xcom_event_horizon | xcom_get_minimum_event_horizon ()=0 |
Function to retrieve XCOM's minimum supported event horizon value. More... | |
virtual xcom_event_horizon | xcom_get_maximum_event_horizon ()=0 |
Function to retrieve XCOM's maximum supported event horizon value. More... | |
virtual bool | xcom_get_event_horizon (uint32_t group_id_hash, xcom_event_horizon &event_horizon)=0 |
Function to retrieve XCOM's event horizon. More... | |
virtual 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)=0 |
Function to retrieve the application payloads decided on a set of synodes. More... | |
virtual bool | xcom_set_event_horizon (uint32_t group_id_hash, xcom_event_horizon event_horizon)=0 |
Function to reconfigure XCOM's event horizon. More... | |
virtual bool | xcom_set_leaders (uint32_t group_id_hash, u_int nr_preferred_leaders, char const *preferred_leaders[], node_no max_nr_leaders)=0 |
virtual bool | xcom_get_leaders (uint32_t group_id_hash, leader_info_data &leaders)=0 |
virtual bool | xcom_set_cache_size (uint64_t size)=0 |
Function to reconfigure the maximum size of the XCom cache. 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... | |
virtual bool | test_xcom_tcp_connection (std::string &host, xcom_port port)=0 |
Performs a test connection to the given XCom instance via TCP. More... | |
virtual bool | initialize_network_manager ()=0 |
Initializes XCom's Network Manager. More... | |
virtual bool | finalize_network_manager ()=0 |
Finalizes XCom's Network Manager. More... | |
virtual bool | set_network_manager_active_provider (enum_transport_protocol new_value)=0 |
Set XCom's network manager active provider. More... | |
|
explicitdefault |
|
virtualdefault |
The destructor.
|
pure virtual |
This function is responsible to delete the list of nodes that had been previously created by new_node_address
.
n | the length of the list |
na | the list to delete |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Finalizes XCom's Network Manager.
This cleans up everythins regarding network.
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Function that retrieves the value that signals that XCom must be forcefully stopped.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Initializes XCom's Network Manager.
This must be called to ensure that we have client connection abilities since the start of GCS.
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
This is an utility member function that is used to call into XCom for creating list with node's addresses and their associated UUIDs.
Note that callers must provide the UUID.
n | The number of elements in the list |
names | The names to be put on the list |
uuids | The UUIDs to be put on the list |
delete_node_address
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Set XCom's network manager active provider.
new_value | the value of the Communication Stack to use. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function that sets the value that signals that XCom must be forcefully stopped.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Performs a test connection to the given XCom instance via TCP.
host | the XCom instance's host |
port | the XCom instance's port |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function to add a node to XCOM.
con | Connection to a node that will carry on the request. |
node | Node information. |
group_id_hash | Hash of group identifier. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function to add a set of nodes to XCOM.
con | Connection to a node that will carry on the request. |
nodes | Set of nodes. |
group_id_hash | Hash of group identifier. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function used to boot a node in XCOM.
node | Node information. |
group_id_hash | Hash of group identifier. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
This member function is responsible to call into XCom consensus and add a node to the group.
The caller is responsible for ensuring that the session has been opened before open_session
and also that the node is not yet in the configuration.
The callee must have opened an XCom connection before calling this function. xcom_client_open_connection
.
fd | the file descriptor to the XCom connection established earlier |
nl | The node list containing the list of peers to add |
group_id | the identifier of the group to which the nodes should be added |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function boots XCom.
nl | List with a single member - the one that boots the group |
group_id | the Group identifier to which the member belongs to |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function closes the connection to an XCom instance.
fd | The connection file descriptor |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This method forces XCom to inject a new configuration in the group, even if it does not contain a majority of members.
nl | The list of nodes that will belong to this new configuration |
group_id | The identifier of the group from which the nodes will belong |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for retrieving the event horizon of the XCom configuration.
This function REQUIRES a prior call to xcom_open_handlers
to establish a connection to XCom.
[in] | group_id | The identifier of the group from which the event horizon will be retrieved |
[out] | event_horizon | A reference to where the group's event horizon value will be written to |
true | if successful and event_horizon was written to |
false | otherwise |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for retrieving the leaders of the XCom configuration.
[in] | group_id | The identifier of the group |
[out] | leaders | A reference to where the group's leaders will be written to |
true | if successful and leaders was written to |
false | otherwise |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for retrieving the application payloads decided in the synodes in synodes
, from the XCom instance connected to via fd
.
[in] | fd | The file descriptor to the XCom connection established earlier |
[in] | group_id | The identifier of the group from which the payloads will be retrieved |
[in] | synodes | The desired synodes |
[out] | reply | Where the requested payloads will be written to |
reply
. Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function opens a connection to an XCom instance.
addr | The XCom instance address |
port | The XCom instance port |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for triggering the removal of a node from the XCom configuration.
This function is asynchronous, so you need to wait for the view change to actually validate that the removal was successful.
The caller is responsible for making sure that the server to be removed is in the group.
The callee must have opened an XCom connection before calling this function. xcom_client_open_connection
.
fd | the file descriptor to the XCom connection established earlier |
nl | The list of nodes to remove from the group |
group_id | The identifier of the group from which the nodes will be removed |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for triggering the removal of a node from the XCom configuration.
This function is asynchronous, so you need to wait for the view change to actually validate that the removal was successful.
The caller is responsible for making sure that the server to be removed is in the group.
This function MUST be called after opening the local XCom session xcom_input_connect
.
nl | The list of nodes to remove from the group |
group_id | The identifier of the group from which the nodes will be removed |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for pushing data into consensus on XCom.
The caller is responsible to making sure that there is an open XCom session xcom_input_connect
and also that the server is part of the XCom configuration before sending data to it.
data
must have been allocated by one of the functions of the malloc family, because data
will be passed on to XCom. XCom is implemented in C and will use free
to dispose of data
when it is finished with data
.
This function takes ownership of data
. This means that this function becomes responsible for the lifetime of data
. Since this function takes ownership of data
, the caller must not interact with data
after passing it to this function.
size | the size of the payload |
data | the payload |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for setting a new value for the maximum size of the XCom cache.
This function is asynchronous, so the return value indicates only whether the request to change the value was successfully pushed to XCom or not. However, since the cache size is set only for the local node, and makes no further verifications on the value, if XCom processes the request, it will accept the new value. The callers of this function must validate that the value set is within the limits set to the maximum size of the XCom cache.
This function REQUIRES a prior call to xcom_open_handlers
to establish a connection to XCom.
size | The new value for the maximum size of the XCom cache. |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for triggering the reconfiguration of the event horizon of the XCom configuration.
This function is asynchronous, so you need to poll xcom_get_event_horizon
to actually validate that the reconfiguration was successful.
This function REQUIRES a prior call to xcom_open_handlers
to establish a connection to XCom.
event_horizon | The desired event horizon value |
group_id | The identifier of the group from which the nodes will be removed |
xcom_client_get_event_horizon
to validate that the event horizon was modified. Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function is responsible for triggering the reconfiguration of the leaders of the XCom configuration.
This function is asynchronous, so you need to poll xcom_get_leaders
to actually validate that the reconfiguration was successful.
group_id | The identifier of the group |
nr_preferred_leaders | Number of preferred leaders, i.e. elements in preferred_leaders |
preferred_leaders | The "host:port" of the preferred leaders |
max_nr_leaders | Maximum number of active leaders |
xcom_client_get_leaders
to validate that the leaders were modified. Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function finishes the XCom thread.
This function must be called when the XCOM thread was started but the node has not joined a group.
There could be errors later in the process of exiting XCom. Since this is basically an asynchronous function, one needs to wait for the XCom thread to to ensure that XCom terminated.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Function to force the set of nodes in XCOM's configuration.
nodes | Set of nodes. |
group_id_hash | Hash of group identifier. |
|
pure virtual |
Function to retrieve XCOM's event horizon.
[in] | group_id_hash | Hash of group identifier. |
[out] | event_horizon | A reference to where the group's event horizon value will be written to |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function to retrieve XCOM's maximum supported event horizon value.
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function to retrieve XCOM's minimum supported event horizon value.
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Function to retrieve the application payloads decided on a set of synodes.
[in] | xcom_instance | The XCom instance to connect to |
[in] | group_id_hash | Hash of group identifier. |
[in] | synode_set | The desired synodes |
[out] | reply | Where the requested payloads will be written to |
reply
. Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member function initializes XCom.
This function must be called before anything else and from within the XCom thread. It will eventually call the main loop inside XCom.
listen_port | the port that the local XCom is to be listening on. |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
|
pure virtual |
Opens the input channel to XCom.
address | address to connect to |
port | port to connect to |
true | if successful |
false | otherwise |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Closes the input channel to XCom.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Attempts to retrieve incoming commands.
(Called by XCom.)
xcom_input_connect
app_data_ptr | linked list of the queued commands if the queue is not empty |
nullptr | if the queue is empty |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Attempts to send the command data
to XCom.
(Called by GCS.)
The function takes ownership of data
.
xcom_input_connect
data | the command to send to XCom |
true | if the command was sent to XCom |
false | if the command was not sent to XCom |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Attempts to send the command data
to XCom, and returns a future to XCom's reply.
(Called by GCS.)
The function takes ownership of data
.
xcom_input_connect
data | the command to send to XCom |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This verifies if XCom has finished or not.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Function to remove a node from XCOM.
node | Node information. |
group_id_hash | Hash of group identifier. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function to remove a set of nodes from XCOM.
con | Connection to a node that will carry on the request. |
nodes | Set of nodes to remove. |
group_id_hash | Hash of group identifier. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function to remove a set of nodes from XCOM.
nodes | Set of nodes. |
group_id_hash | Hash of group identifier. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Function to reconfigure the maximum size of the XCom cache.
size | Cache size limit. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Clean up variables used to notify states in the XCOM's state machine.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Function to reconfigure XCOM's event horizon.
group_id_hash | Hash of group identifier. |
event_horizon | Desired event horizon value. |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
This sets whether XCom has finished or not.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_base.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This modifies the internal cached status and signals all threads that might be waiting on xcom_wait_exit.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Return whether the SSL will be used to encrypt data or not.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Call this method to wait for XCom to exit.
Call this method to wait for XCom to exit. It will block until XCom has exit or an error occurs.
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
Call this method to wait for XCom communications to be initialized.
Call this method to wait for XCom communications to be initialized. It will block until XCom communications are either OK or error out. The value of the status (XCOM_COMMS_OK or XCOM_COMMS_ERROR) is written into the status out parameters.
[out] | status | value of the XCom communication layer status. It can be either XCOM_COMMS_OK or XCOM_COMMS_ERROR |
Implemented in Gcs_xcom_proxy_impl.
|
pure virtual |
This member waits for XCom to be initialized.
Implemented in Gcs_xcom_proxy_impl.