MySQL 8.4.2
Source Code Documentation
|
This class contains information on the configuration, i.e set of nodes or simply site definition. More...
#include <gcs_xcom_group_member_information.h>
Public Member Functions | |
Gcs_xcom_nodes () | |
Constructor that reads the site definition and whether a node is considered dead or alive to build a list of addresses and statuses. More... | |
Gcs_xcom_nodes (const site_def *site, node_set &nodes) | |
Constructor that reads the site definition and whether a node is considered dead or alive to build a list of addresses and statuses. More... | |
virtual | ~Gcs_xcom_nodes () |
Destructor for Gcs_xcom_nodes. More... | |
void | set_node_no (unsigned int node_no) |
unsigned int | get_node_no () const |
Return the index of the current node (i.e. More... | |
bool | is_valid () const |
Return with the configuration is valid or not. More... | |
const std::vector< Gcs_xcom_node_information > & | get_nodes () const |
Return a reference to the addresses' vector. More... | |
const Gcs_xcom_node_information * | get_node (const Gcs_member_identifier &member_id) const |
Return a pointer to a node if it exists, otherwise NULL. More... | |
const Gcs_xcom_node_information * | get_node (const std::string &member_id) const |
Return a pointer to a node if it exists, otherwise NULL. More... | |
const Gcs_xcom_node_information * | get_node (unsigned int node_no) const |
Return a pointer to a node if it exists, otherwise NULL. More... | |
const Gcs_xcom_node_information * | get_node (const Gcs_xcom_uuid &uuid) const |
Return a pointer to a node if it exists, otherwise NULL. More... | |
void | add_node (const Gcs_xcom_node_information &node) |
Add a node to the set of nodes. More... | |
void | remove_node (const Gcs_xcom_node_information &node) |
Remove a node from the set of nodes. More... | |
void | add_nodes (const Gcs_xcom_nodes &xcom_nodes) |
Clear up the current set and add a new set of nodes. More... | |
void | clear_nodes () |
Clear the set of nodes. More... | |
unsigned int | get_size () const |
Return the number of nodes in the set. More... | |
bool | empty () const |
Whether the set of nodes is empty or not. More... | |
bool | encode (unsigned int *ptr_size, char const ***ptr_addrs, blob **ptr_uuids) |
Encode the information on the set of nodes in a format that can be interpreted by XCOM to boot, add or remove nodes. More... | |
Private Member Functions | |
void | free_encode () |
Gcs_xcom_nodes (const Gcs_xcom_nodes &) | |
Gcs_xcom_nodes & | operator= (const Gcs_xcom_nodes &) |
Private Attributes | |
unsigned int | m_node_no |
std::vector< Gcs_xcom_node_information > | m_nodes |
unsigned int | m_size |
char const ** | m_addrs |
blob * | m_uuids |
This class contains information on the configuration, i.e set of nodes or simply site definition.
Users are responsible for guaranteeing that information encapsulated by different Gcs_xcom_nodes is properly defined. In the sense that the member identifier, the unique identifier and the address uniquely identify a node and the same holds for any combination of those three.
Nodes inserted in this set are copied and stored in a vector object. Currently, we don't check whether the same node is inserted twice or not and as such duplicated entries are allowed. Users are responsible for guaranteeing that duplicated entries are not inserted.
|
explicit |
Constructor that reads the site definition and whether a node is considered dead or alive to build a list of addresses and statuses.
|
explicit |
Constructor that reads the site definition and whether a node is considered dead or alive to build a list of addresses and statuses.
|
virtual |
Destructor for Gcs_xcom_nodes.
|
private |
void Gcs_xcom_nodes::add_node | ( | const Gcs_xcom_node_information & | node | ) |
Add a node to the set of nodes.
Note that the method does not verify if the node already exists.
void Gcs_xcom_nodes::add_nodes | ( | const Gcs_xcom_nodes & | xcom_nodes | ) |
Clear up the current set and add a new set of nodes.
xcom_nodes | Set of nodes. |
void Gcs_xcom_nodes::clear_nodes | ( | ) |
Clear the set of nodes.
bool Gcs_xcom_nodes::empty | ( | ) | const |
Whether the set of nodes is empty or not.
bool Gcs_xcom_nodes::encode | ( | unsigned int * | ptr_size, |
char const *** | ptr_addrs, | ||
blob ** | ptr_uuids | ||
) |
Encode the information on the set of nodes in a format that can be interpreted by XCOM to boot, add or remove nodes.
|
private |
const Gcs_xcom_node_information * Gcs_xcom_nodes::get_node | ( | const Gcs_member_identifier & | member_id | ) | const |
Return a pointer to a node if it exists, otherwise NULL.
const Gcs_xcom_node_information * Gcs_xcom_nodes::get_node | ( | const Gcs_xcom_uuid & | uuid | ) | const |
Return a pointer to a node if it exists, otherwise NULL.
const Gcs_xcom_node_information * Gcs_xcom_nodes::get_node | ( | const std::string & | member_id | ) | const |
Return a pointer to a node if it exists, otherwise NULL.
const Gcs_xcom_node_information * Gcs_xcom_nodes::get_node | ( | unsigned int | node_no | ) | const |
Return a pointer to a node if it exists, otherwise NULL.
unsigned int Gcs_xcom_nodes::get_node_no | ( | ) | const |
Return the index of the current node (i.e.
member).
const std::vector< Gcs_xcom_node_information > & Gcs_xcom_nodes::get_nodes | ( | ) | const |
Return a reference to the addresses' vector.
unsigned int Gcs_xcom_nodes::get_size | ( | ) | const |
Return the number of nodes in the set.
|
inline |
Return with the configuration is valid or not.
|
private |
void Gcs_xcom_nodes::remove_node | ( | const Gcs_xcom_node_information & | node | ) |
Remove a node from the set of nodes.
node | Node to be removed from the set of nodes. |
void Gcs_xcom_nodes::set_node_no | ( | unsigned int | node_no | ) |
|
private |
|
private |
|
private |
|
private |
|
private |