MySQL 8.0.39
Source Code Documentation
Gcs_xcom_communication_interface Class Referenceabstract

Abstraction layer that adds XCom specific methods to the generic communication interface. More...

#include <gcs_xcom_communication_interface.h>

Inheritance diagram for Gcs_xcom_communication_interface:
[legend]

Public Member Functions

virtual enum_gcs_error do_send_message (const Gcs_message &message_to_send, unsigned long long *message_length, Cargo_type cargo)=0
 Sends a message that is internal to the binding implementation. More...
 
virtual Gcs_message_pipelineget_msg_pipeline ()=0
 
virtual void buffer_incoming_packet (Gcs_packet &&packet, std::unique_ptr< Gcs_xcom_nodes > &&xcom_nodes)=0
 Buffer packets when a view is not installed yet and the state exchange phase is being executed. More...
 
virtual void deliver_buffered_packets ()=0
 The state exchange phase has been executed and the view has been installed so this is used to send any buffered packet to upper layers. More...
 
virtual void cleanup_buffered_packets ()=0
 
virtual size_t number_buffered_packets ()=0
 Return the number of buffered packets. More...
 
virtual void update_members_information (const Gcs_member_identifier &me, const Gcs_xcom_nodes &members)=0
 Notify the pipeline about the new XCom membership when a state exchange begins. More...
 
virtual bool recover_packets (Gcs_xcom_synode_set const &synodes)=0
 Attempts to recover the missing packets that are required for a node to join the group successfully. More...
 
virtual Gcs_messageconvert_packet_to_message (Gcs_packet &&packet, std::unique_ptr< Gcs_xcom_nodes > &&xcom_nodes)=0
 Converts the packet into a message that can be delivered to the upper layer. More...
 
virtual void process_user_data_packet (Gcs_packet &&packet, std::unique_ptr< Gcs_xcom_nodes > &&xcom_nodes)=0
 The purpose of this method is to be called when in Gcs_xcom_interface callback method xcom_receive_data is invoked. More...
 
 ~Gcs_xcom_communication_interface () override=default
 
- Public Member Functions inherited from Gcs_communication_interface
virtual enum_gcs_error send_message (const Gcs_message &message_to_send)=0
 Method used to broadcast a message to a group in which this interface pertains. More...
 
virtual int add_event_listener (const Gcs_communication_event_listener &event_listener)=0
 Registers an implementation of a Gcs_communication_event_listener that will receive Communication Events. More...
 
virtual void remove_event_listener (int event_listener_handle)=0
 Removes a previously registered event listener. More...
 
virtual Gcs_protocol_version get_protocol_version () const =0
 Retrieves the current GCS protocol version in use. More...
 
virtual std::pair< bool, std::future< void > > set_protocol_version (Gcs_protocol_version new_version)=0
 Modifies the GCS protocol version in use. More...
 
virtual Gcs_protocol_version get_maximum_supported_protocol_version () const =0
 Get the maximum protocol version currently supported by the group. More...
 
virtual void set_communication_protocol (enum_transport_protocol protocol)=0
 Sets the communication protocol to use. More...
 
virtual enum_transport_protocol get_incoming_connections_protocol ()=0
 Get the incoming connections protocol which is currently active. More...
 
virtual ~Gcs_communication_interface ()=default
 

Detailed Description

Abstraction layer that adds XCom specific methods to the generic communication interface.

Implementation of the Gcs_communication_interface for xcom.

This adds the following functionalities to the generic Gcs_communication_interface:

  • Ability to send messages without view safety and stats counter. This method shall be used by the State Exchange algorithm when the high-level view change is still occurring.
  • Delegation method that will contain all the business logic related with messages delivery to registered clients.

Constructor & Destructor Documentation

◆ ~Gcs_xcom_communication_interface()

Gcs_xcom_communication_interface::~Gcs_xcom_communication_interface ( )
overridedefault

Member Function Documentation

◆ buffer_incoming_packet()

virtual void Gcs_xcom_communication_interface::buffer_incoming_packet ( Gcs_packet &&  packet,
std::unique_ptr< Gcs_xcom_nodes > &&  xcom_nodes 
)
pure virtual

Buffer packets when a view is not installed yet and the state exchange phase is being executed.

Note that this method must be executed by the same thread that processes global view messages and data message in order to avoid any concurrency issue.

Parameters
packetPacket to buffer.
xcom_nodesMembership at the time the packet was received

Implemented in Gcs_xcom_communication.

◆ cleanup_buffered_packets()

virtual void Gcs_xcom_communication_interface::cleanup_buffered_packets ( )
pure virtual

Implemented in Gcs_xcom_communication.

◆ convert_packet_to_message()

virtual Gcs_message * Gcs_xcom_communication_interface::convert_packet_to_message ( Gcs_packet &&  packet,
std::unique_ptr< Gcs_xcom_nodes > &&  xcom_nodes 
)
pure virtual

Converts the packet into a message that can be delivered to the upper layer.

Parameters
packetThe packet to convert
xcom_nodesThe membership at the time the packet was delivered
Return values
Gcs_message*if successful
nullptrif unsuccessful

Implemented in Gcs_xcom_communication.

◆ deliver_buffered_packets()

virtual void Gcs_xcom_communication_interface::deliver_buffered_packets ( )
pure virtual

The state exchange phase has been executed and the view has been installed so this is used to send any buffered packet to upper layers.

Note that this method must be executed by the same thread that processes global view messages and data message in order to avoid any concurrency issue.

Implemented in Gcs_xcom_communication.

◆ do_send_message()

virtual enum_gcs_error Gcs_xcom_communication_interface::do_send_message ( const Gcs_message message_to_send,
unsigned long long *  message_length,
Cargo_type  cargo 
)
pure virtual

Sends a message that is internal to the binding implementation.

This message will not be subject to the same restrictions of send_message. As such, it will not observe view safety nor will count for the statistics of messages sent.

Parameters
[in]message_to_sendthe message to send
[out]message_lengththe length of message which was send if GCS_OK, unspecified otherwise
[in]cargointernal message header cargo type
Returns
the xcom broadcast message error
Return values
GCS_OKmessage is transmitted successfully
GCS_NOKerror occurred while transmitting message
GCS_MESSAGE_TOO_BIGmessage is bigger then xcom can handle

Implemented in Gcs_xcom_communication.

◆ get_msg_pipeline()

virtual Gcs_message_pipeline & Gcs_xcom_communication_interface::get_msg_pipeline ( )
pure virtual

Implemented in Gcs_xcom_communication.

◆ number_buffered_packets()

virtual size_t Gcs_xcom_communication_interface::number_buffered_packets ( )
pure virtual

Return the number of buffered packets.

Note that this method must be executed by the same thread that processes global view messages and data message in order to avoid any concurrency issue.

Implemented in Gcs_xcom_communication.

◆ process_user_data_packet()

virtual void Gcs_xcom_communication_interface::process_user_data_packet ( Gcs_packet &&  packet,
std::unique_ptr< Gcs_xcom_nodes > &&  xcom_nodes 
)
pure virtual

The purpose of this method is to be called when in Gcs_xcom_interface callback method xcom_receive_data is invoked.

This allows, in terms of software architecture, to concentrate all the message delivery logic and processing in a single place.

The deliver_message callback that is registered in XCom (in gcs_xcom_interface.h) and that actually receives the low-level messages, is implemented as a delegator to this method.

Note that the method will be responsible for deleting the message passed as parameter and must be executed by the same thread that processes global view messages and data message in order to avoid any concurrency issue.

Implemented in Gcs_xcom_communication.

◆ recover_packets()

virtual bool Gcs_xcom_communication_interface::recover_packets ( Gcs_xcom_synode_set const &  synodes)
pure virtual

Attempts to recover the missing packets that are required for a node to join the group successfully.

For example, the missing packets may be some fragments of a message that have already been delivered by XCom to the existing members of the group. The joining node needs those fragments in order to be able to deliver the reassembled message when the final fragments are delivered by XCom.

Note that this method must be executed by the same thread that processes global view messages and data message in order to avoid any concurrency issue.

Parameters
synodesThe synodes where the required packets were decided
Returns
true If successful, false otherwise

Implemented in Gcs_xcom_communication.

◆ update_members_information()

virtual void Gcs_xcom_communication_interface::update_members_information ( const Gcs_member_identifier me,
const Gcs_xcom_nodes members 
)
pure virtual

Notify the pipeline about the new XCom membership when a state exchange begins.

Note that this method must be executed by the same thread that processes global view messages and data message in order to avoid any concurrency issue.

Parameters
meThe identifier of this server
membersThe XCom membership

Implemented in Gcs_xcom_communication.


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