MySQL 9.1.0
Source Code Documentation
|
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_information & | operator= (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_identifier & | get_member_id () const |
const Gcs_xcom_uuid & | get_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... | |
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.
|
explicit |
Gcs_xcom_node_information constructor.
[in] | member_id | the member identifier |
[in] | alive | whether the node is alive or not. |
|
explicit |
Gcs_xcom_node_information constructor.
[in] | member_id | the member identifier |
[in] | uuid | the member uuid |
[in] | node_no | the member node number |
[in] | alive | whether the node is alive or not. |
|
virtualdefault |
|
default |
synode_no Gcs_xcom_node_information::get_max_synode | ( | ) | const |
Gets the highest synode_no known by the group when the node became unreachable.
const Gcs_member_identifier & Gcs_xcom_node_information::get_member_id | ( | ) | const |
const Gcs_xcom_uuid & Gcs_xcom_node_information::get_member_uuid | ( | ) | const |
unsigned int Gcs_xcom_node_information::get_node_no | ( | ) | const |
Return member node_no.
uint64_t Gcs_xcom_node_information::get_suspicion_creation_timestamp | ( | ) | const |
Gets the timestamp that indicates the creation of the suspicion.
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.
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.
[in] | ts | Provided timestamp |
[in] | timeout | Provided timeout |
bool Gcs_xcom_node_information::is_alive | ( | ) | const |
Get whether the member is alive or not.
bool Gcs_xcom_node_information::is_member | ( | ) | const |
Get whether the node is already a member of the group or not.
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.
xcom_proxy | XCom proxy |
{true,nullptr} | if there was an error creating the node_address |
{false,node_address*} | if the node_address was successfully created |
|
default |
void Gcs_xcom_node_information::regenerate_member_uuid | ( | ) |
Regenerate the member uuid.
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.
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.
void Gcs_xcom_node_information::set_member | ( | bool | m | ) |
Set whether the node is already a member of the group or not.
void Gcs_xcom_node_information::set_node_no | ( | unsigned int | node_no | ) |
Set the member node_no.
void Gcs_xcom_node_information::set_suspicion_creation_timestamp | ( | uint64_t | ts | ) |
Sets the timestamp to indicate the creation of the suspicion.
|
private |
Whether the member is alive or dead.
|
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.
|
private |
The highest synode known by the group when the node became unreachable.
|
private |
Whether the node is a member of the group or not.
|
private |
|
private |
Member node_no.
|
private |
Stores the timestamp of the creation of the suspicion.
|
private |
Member unique identifier.