MySQL 8.3.0
Source Code Documentation
Gcs_xcom_node_information Class Reference

It represents a node within a group and is identified by the member identifier, unique identifier and node number. More...

#include <gcs_xcom_group_member_information.h>

Public Member Functions

 Gcs_xcom_node_information (const std::string &member_id, bool alive=true)
 Gcs_xcom_node_information constructor. More...
 
 Gcs_xcom_node_information (const std::string &member_id, const Gcs_xcom_uuid &uuid, const unsigned int node_no, const bool alive)
 Gcs_xcom_node_information constructor. More...
 
virtual ~Gcs_xcom_node_information ()=default
 
 Gcs_xcom_node_information (const Gcs_xcom_node_information &)=default
 
Gcs_xcom_node_informationoperator= (const Gcs_xcom_node_information &)=default
 
void set_suspicion_creation_timestamp (uint64_t ts)
 Sets the timestamp to indicate the creation of the suspicion. More...
 
uint64_t get_suspicion_creation_timestamp () const
 Gets the timestamp that indicates the creation of the suspicion. More...
 
bool has_timed_out (uint64_t ts, uint64_t timeout)
 Compares the object's timestamp with the received one, in order to check if the suspicion has timed out and the suspect node must be removed. More...
 
const Gcs_member_identifierget_member_id () const
 
const Gcs_xcom_uuidget_member_uuid () const
 
void regenerate_member_uuid ()
 Regenerate the member uuid. More...
 
void set_node_no (unsigned int)
 Set the member node_no. More...
 
unsigned int get_node_no () const
 Return member node_no. More...
 
bool is_alive () const
 Get whether the member is alive or not. More...
 
bool is_member () const
 Get whether the node is already a member of the group or not. More...
 
void set_member (bool m)
 Set whether the node is already a member of the group or not. More...
 
bool has_lost_messages () const
 Get whether the local XCom cache has removed messages that the remote node represented by this object has missed. More...
 
void set_lost_messages (bool lost_msgs)
 Set whether the local XCom cache has removed messages that the node has missed. More...
 
synode_no get_max_synode () const
 Gets the highest synode_no known by the group when the node became unreachable. More...
 
void set_max_synode (synode_no synode)
 Sets the highest synode_no known by the group when the node became unreachable. More...
 
std::pair< bool, node_address * > make_xcom_identity (Gcs_xcom_proxy &xcom_proxy) const
 Converts this node information into its corresponding XCom node_address type. More...
 

Private Attributes

Gcs_member_identifier m_member_id
 
Gcs_xcom_uuid m_uuid
 Member unique identifier. More...
 
unsigned int m_node_no
 Member node_no. More...
 
bool m_alive
 Whether the member is alive or dead. More...
 
bool m_member
 Whether the node is a member of the group or not. More...
 
uint64_t m_suspicion_creation_timestamp
 Stores the timestamp of the creation of the suspicion. More...
 
bool m_lost_messages
 Indicates whether the local XCom cache has removed messages that the remote node represented by this object has missed. More...
 
synode_no m_max_synode
 The highest synode known by the group when the node became unreachable. More...
 

Detailed Description

It represents a node within a group and is identified by the member identifier, unique identifier and node number.

Users are responsible for guaranteeing that they are related to the same node.

One should avoid creating this representation from outside the binding, since each one might have its own internal representations. Instead one should use the Gcs_control_interface::get_local_information method to know our own identification within the group.

Note also that it is possible to use the copy constructor and assignment operator and these properties are required by several other classes such as the Gcs_xcom_nodes.

Constructor & Destructor Documentation

◆ Gcs_xcom_node_information() [1/3]

Gcs_xcom_node_information::Gcs_xcom_node_information ( const std::string &  member_id,
bool  alive = true 
)
explicit

Gcs_xcom_node_information constructor.

Parameters
[in]member_idthe member identifier
[in]alivewhether the node is alive or not.

◆ Gcs_xcom_node_information() [2/3]

Gcs_xcom_node_information::Gcs_xcom_node_information ( const std::string &  member_id,
const Gcs_xcom_uuid uuid,
const unsigned int  node_no,
const bool  alive 
)
explicit

Gcs_xcom_node_information constructor.

Parameters
[in]member_idthe member identifier
[in]uuidthe member uuid
[in]node_nothe member node number
[in]alivewhether the node is alive or not.

◆ ~Gcs_xcom_node_information()

virtual Gcs_xcom_node_information::~Gcs_xcom_node_information ( )
virtualdefault

◆ Gcs_xcom_node_information() [3/3]

Gcs_xcom_node_information::Gcs_xcom_node_information ( const Gcs_xcom_node_information )
default

Member Function Documentation

◆ get_max_synode()

synode_no Gcs_xcom_node_information::get_max_synode ( ) const

Gets the highest synode_no known by the group when the node became unreachable.

◆ get_member_id()

const Gcs_member_identifier & Gcs_xcom_node_information::get_member_id ( ) const
Returns
the member identifier

◆ get_member_uuid()

const Gcs_xcom_uuid & Gcs_xcom_node_information::get_member_uuid ( ) const
Returns
the member uuid

◆ get_node_no()

unsigned int Gcs_xcom_node_information::get_node_no ( ) const

Return member node_no.

◆ get_suspicion_creation_timestamp()

uint64_t Gcs_xcom_node_information::get_suspicion_creation_timestamp ( ) const

Gets the timestamp that indicates the creation of the suspicion.

◆ has_lost_messages()

bool Gcs_xcom_node_information::has_lost_messages ( ) const

Get whether the local XCom cache has removed messages that the remote node represented by this object has missed.

When this happens, the remote node will no longer be able to recover the missed messages from the local node and a corresponding message will be printed to the local node's error log. The message will only be printed the first time a missed message is lost.

◆ has_timed_out()

bool Gcs_xcom_node_information::has_timed_out ( uint64_t  ts,
uint64_t  timeout 
)

Compares the object's timestamp with the received one, in order to check if the suspicion has timed out and the suspect node must be removed.

Parameters
[in]tsProvided timestamp
[in]timeoutProvided timeout
Returns
Indicates if the suspicion has timed out

◆ is_alive()

bool Gcs_xcom_node_information::is_alive ( ) const

Get whether the member is alive or not.

◆ is_member()

bool Gcs_xcom_node_information::is_member ( ) const

Get whether the node is already a member of the group or not.

◆ make_xcom_identity()

std::pair< bool, node_address * > Gcs_xcom_node_information::make_xcom_identity ( Gcs_xcom_proxy xcom_proxy) const

Converts this node information into its corresponding XCom node_address type.

Parameters
xcom_proxyXCom proxy
Return values
{true,nullptr}if there was an error creating the node_address
{false,node_address*}if the node_address was successfully created

◆ operator=()

Gcs_xcom_node_information & Gcs_xcom_node_information::operator= ( const Gcs_xcom_node_information )
default

◆ regenerate_member_uuid()

void Gcs_xcom_node_information::regenerate_member_uuid ( )

Regenerate the member uuid.

◆ set_lost_messages()

void Gcs_xcom_node_information::set_lost_messages ( bool  lost_msgs)

Set whether the local XCom cache has removed messages that the node has missed.

◆ set_max_synode()

void Gcs_xcom_node_information::set_max_synode ( synode_no  synode)

Sets the highest synode_no known by the group when the node became unreachable.

◆ set_member()

void Gcs_xcom_node_information::set_member ( bool  m)

Set whether the node is already a member of the group or not.

◆ set_node_no()

void Gcs_xcom_node_information::set_node_no ( unsigned int  node_no)

Set the member node_no.

◆ set_suspicion_creation_timestamp()

void Gcs_xcom_node_information::set_suspicion_creation_timestamp ( uint64_t  ts)

Sets the timestamp to indicate the creation of the suspicion.

Member Data Documentation

◆ m_alive

bool Gcs_xcom_node_information::m_alive
private

Whether the member is alive or dead.

◆ m_lost_messages

bool Gcs_xcom_node_information::m_lost_messages
private

Indicates whether the local XCom cache has removed messages that the remote node represented by this object has missed.

Used to avoid printing the corresponding error message more than once.

◆ m_max_synode

synode_no Gcs_xcom_node_information::m_max_synode
private

The highest synode known by the group when the node became unreachable.

◆ m_member

bool Gcs_xcom_node_information::m_member
private

Whether the node is a member of the group or not.

◆ m_member_id

Gcs_member_identifier Gcs_xcom_node_information::m_member_id
private

◆ m_node_no

unsigned int Gcs_xcom_node_information::m_node_no
private

Member node_no.

◆ m_suspicion_creation_timestamp

uint64_t Gcs_xcom_node_information::m_suspicion_creation_timestamp
private

Stores the timestamp of the creation of the suspicion.

◆ m_uuid

Gcs_xcom_uuid Gcs_xcom_node_information::m_uuid
private

Member unique identifier.


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