MySQL 9.1.0
Source Code Documentation
Gcs_xcom_nodes Class Reference

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_informationget_node (const Gcs_member_identifier &member_id) const
 Return a pointer to a node if it exists, otherwise NULL. More...
 
const Gcs_xcom_node_informationget_node (const std::string &member_id) const
 Return a pointer to a node if it exists, otherwise NULL. More...
 
const Gcs_xcom_node_informationget_node (unsigned int node_no) const
 Return a pointer to a node if it exists, otherwise NULL. More...
 
const Gcs_xcom_node_informationget_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_nodesoperator= (const Gcs_xcom_nodes &)
 

Private Attributes

unsigned int m_node_no
 
std::vector< Gcs_xcom_node_informationm_nodes
 
unsigned int m_size
 
char const ** m_addrs
 
blob * m_uuids
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Gcs_xcom_nodes() [1/3]

Gcs_xcom_nodes::Gcs_xcom_nodes ( )
explicit

Constructor that reads the site definition and whether a node is considered dead or alive to build a list of addresses and statuses.

◆ Gcs_xcom_nodes() [2/3]

Gcs_xcom_nodes::Gcs_xcom_nodes ( const site_def site,
node_set &  nodes 
)
explicit

Constructor that reads the site definition and whether a node is considered dead or alive to build a list of addresses and statuses.

◆ ~Gcs_xcom_nodes()

Gcs_xcom_nodes::~Gcs_xcom_nodes ( )
virtual

Destructor for Gcs_xcom_nodes.

◆ Gcs_xcom_nodes() [3/3]

Gcs_xcom_nodes::Gcs_xcom_nodes ( const Gcs_xcom_nodes )
private

Member Function Documentation

◆ add_node()

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.

◆ add_nodes()

void Gcs_xcom_nodes::add_nodes ( const Gcs_xcom_nodes xcom_nodes)

Clear up the current set and add a new set of nodes.

Parameters
xcom_nodesSet of nodes.

◆ clear_nodes()

void Gcs_xcom_nodes::clear_nodes ( )

Clear the set of nodes.

◆ empty()

bool Gcs_xcom_nodes::empty ( ) const

Whether the set of nodes is empty or not.

◆ encode()

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.

◆ free_encode()

void Gcs_xcom_nodes::free_encode ( )
private

◆ get_node() [1/4]

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.

◆ get_node() [2/4]

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.

◆ get_node() [3/4]

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.

◆ get_node() [4/4]

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.

◆ get_node_no()

unsigned int Gcs_xcom_nodes::get_node_no ( ) const

Return the index of the current node (i.e.

member).

◆ get_nodes()

const std::vector< Gcs_xcom_node_information > & Gcs_xcom_nodes::get_nodes ( ) const

Return a reference to the addresses' vector.

◆ get_size()

unsigned int Gcs_xcom_nodes::get_size ( ) const

Return the number of nodes in the set.

◆ is_valid()

bool Gcs_xcom_nodes::is_valid ( void  ) const
inline

Return with the configuration is valid or not.

◆ operator=()

Gcs_xcom_nodes & Gcs_xcom_nodes::operator= ( const Gcs_xcom_nodes )
private

◆ remove_node()

void Gcs_xcom_nodes::remove_node ( const Gcs_xcom_node_information node)

Remove a node from the set of nodes.

Parameters
nodeNode to be removed from the set of nodes.

◆ set_node_no()

void Gcs_xcom_nodes::set_node_no ( unsigned int  node_no)

Member Data Documentation

◆ m_addrs

char const** Gcs_xcom_nodes::m_addrs
private

◆ m_node_no

unsigned int Gcs_xcom_nodes::m_node_no
private

◆ m_nodes

std::vector<Gcs_xcom_node_information> Gcs_xcom_nodes::m_nodes
private

◆ m_size

unsigned int Gcs_xcom_nodes::m_size
private

◆ m_uuids

blob* Gcs_xcom_nodes::m_uuids
private

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