24#ifndef GCS_XCOM_COMMUNICATION_INTERFACE_INCLUDED
25#define GCS_XCOM_COMMUNICATION_INTERFACE_INCLUDED
80 unsigned long long *message_length,
98 Gcs_packet &&packet, std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) = 0;
176 Gcs_packet &&packet, std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) = 0;
196 Gcs_packet &&packet, std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) = 0;
226 std::unique_ptr<Network_provider_management_interface> comms_mgmt);
257 unsigned long long *message_length,
261 std::map<int, const Gcs_communication_event_listener &>
268 std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes)
override;
283 std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes)
override;
287 std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes)
override;
325 std::vector<std::pair<Gcs_packet, std::unique_ptr<Gcs_xcom_nodes>>>
345 std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes);
375 synode_app_data_array &recovered_data);
381 synode_app_data_array
const &recovered_data);
387 synode_app_data
const &recovered_data);
This interface is implemented by those who wish to receive messages.
Definition: gcs_communication_event_listener.h:36
This interface represents all the communication facilities that a binding implementation should provi...
Definition: gcs_communication_interface.h:90
This represents the unique identification of a group.
Definition: gcs_group_identifier.h:35
It represents the identity of a group member within a certain group.
Definition: gcs_member_identifier.h:40
This is the pipeline that an outgoing or incoming message has to go through when being sent to or rec...
Definition: gcs_message_stages.h:365
Class that represents the data that is exchanged within a group.
Definition: gcs_message.h:357
This class is an abstraction for the packet concept.
Definition: gcs_internal_message.h:58
Abstraction layer that adds XCom specific methods to the generic communication interface.
Definition: gcs_xcom_communication_interface.h:60
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_da...
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.
virtual Gcs_message * convert_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.
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.
virtual void cleanup_buffered_packets()=0
~Gcs_xcom_communication_interface() override=default
virtual size_t number_buffered_packets()=0
Return the number of buffered packets.
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.
virtual Gcs_message_pipeline & get_msg_pipeline()=0
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 an...
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.
Implements the communication protocol change logic.
Definition: gcs_xcom_communication_protocol_changer.h:217
Definition: gcs_xcom_communication_interface.h:206
std::map< int, const Gcs_communication_event_listener & > event_listeners
Definition: gcs_xcom_communication_interface.h:304
Gcs_message_pipeline m_msg_pipeline
The pipeline of stages a message has to go through before it is delivered to the application or sent ...
Definition: gcs_xcom_communication_interface.h:319
size_t number_buffered_packets() override
Return the number of buffered packets.
Definition: gcs_xcom_communication_interface.cc:250
bool recover_packets(Gcs_xcom_synode_set const &synodes) override
Attempts to recover the missing packets that are required for a node to join the group successfully.
Definition: gcs_xcom_communication_interface.cc:447
Gcs_message_pipeline & get_msg_pipeline() override
Definition: gcs_xcom_communication_interface.h:264
Gcs_message * convert_packet_to_message(Gcs_packet &&packet, std::unique_ptr< Gcs_xcom_nodes > &&xcom_nodes) override
Converts the packet into a message that can be delivered to the upper layer.
Definition: gcs_xcom_communication_interface.cc:490
packet_recovery_result process_recovered_packets(synode_app_data_array const &recovered_data)
Processes all the recovered packets.
Definition: gcs_xcom_communication_interface.cc:356
void notify_received_message(std::unique_ptr< Gcs_message > &&message)
Notify upper layers that a message has been received.
Definition: gcs_xcom_communication_interface.cc:202
void set_communication_protocol(enum_transport_protocol protocol) override
Sets the communication protocol to use.
Definition: gcs_xcom_communication_interface.cc:640
void deliver_user_data_packet(Gcs_packet &&packet, std::unique_ptr< Gcs_xcom_nodes > &&xcom_nodes)
Delivers the packet to the upper layer.
Definition: gcs_xcom_communication_interface.cc:602
packet_recovery_result recover_packets_from_donor(Gcs_xcom_node_information const &donor, Gcs_xcom_synode_set const &synodes, synode_app_data_array &recovered_data)
Attempts to recover the packets delivered in synodes from donor.
Definition: gcs_xcom_communication_interface.cc:377
std::unique_ptr< Network_provider_management_interface > m_comms_mgmt_interface
Definition: gcs_xcom_communication_interface.h:338
Gcs_xcom_communication(Gcs_xcom_statistics_updater *stats, Gcs_xcom_proxy *proxy, Gcs_xcom_view_change_control_interface *view_control, Gcs_xcom_engine *gcs_engine, Gcs_group_identifier const &group_id, std::unique_ptr< Network_provider_management_interface > comms_mgmt)
Gcs_xcom_communication_interface constructor.
Definition: gcs_xcom_communication_interface.cc:59
void deliver_buffered_packets() override
The state exchange phase has been executed and the view has been installed so this is used to send an...
Definition: gcs_xcom_communication_interface.cc:232
Gcs_protocol_version get_protocol_version() const override
Retrieves the current GCS protocol version in use.
Definition: gcs_xcom_communication_interface.cc:621
void buffer_incoming_packet(Gcs_packet &&packet, std::unique_ptr< Gcs_xcom_nodes > &&xcom_nodes) override
Buffer packets when a view is not installed yet and the state exchange phase is being executed.
Definition: gcs_xcom_communication_interface.cc:222
Gcs_protocol_version get_maximum_supported_protocol_version() const override
Get the maximum protocol version currently supported by the group.
Definition: gcs_xcom_communication_interface.cc:631
Gcs_xcom_proxy * m_xcom_proxy
Definition: gcs_xcom_communication_interface.h:310
void set_maximum_supported_protocol_version(Gcs_protocol_version version)
Definition: gcs_xcom_communication_interface.cc:635
enum_gcs_error send_message(const Gcs_message &message_to_send) override
Implementation of the public send_message method defined in Gcs_xcom_communication.
Definition: gcs_xcom_communication_interface.cc:86
~Gcs_xcom_communication() override
std::vector< Gcs_xcom_node_information > possible_packet_recovery_donors() const
Definition: gcs_xcom_communication_interface.cc:261
void remove_event_listener(int event_listener_handle) override
Removes a previously registered event listener.
Definition: gcs_xcom_communication_interface.cc:198
Gcs_xcom_nodes m_xcom_nodes
Most recent XCom membership known.
Definition: gcs_xcom_communication_interface.h:329
Gcs_xcom_communication & operator=(const Gcs_xcom_communication &)
enum_gcs_error do_send_message(const Gcs_message &message_to_send, unsigned long long *message_length, Cargo_type cargo) override
Sends a message that is internal to the binding implementation.
Definition: gcs_xcom_communication_interface.cc:116
Gcs_xcom_statistics_updater * stats
Definition: gcs_xcom_communication_interface.h:307
void update_members_information(const Gcs_member_identifier &me, const Gcs_xcom_nodes &members) override
Notify the pipeline about the new XCom membership when a state exchange begins.
Definition: gcs_xcom_communication_interface.cc:254
packet_recovery_result process_recovered_packet(synode_app_data const &recovered_data)
Processes a single recovered packet.
Definition: gcs_xcom_communication_interface.cc:286
void log_packet_recovery_failure(packet_recovery_result const &error_code, Gcs_xcom_node_information const &donor) const
Logs the packet recovery failure.
Definition: gcs_xcom_communication_interface.cc:404
Gcs_xcom_communication(const Gcs_xcom_communication &)
enum_transport_protocol get_incoming_connections_protocol() override
Get the incoming connections protocol which is currently active.
Definition: gcs_xcom_communication_interface.cc:646
void process_user_data_packet(Gcs_packet &&packet, std::unique_ptr< Gcs_xcom_nodes > &&xcom_nodes) override
The purpose of this method is to be called when in Gcs_xcom_interface callback method xcom_receive_da...
Definition: gcs_xcom_communication_interface.cc:547
std::map< int, const Gcs_communication_event_listener & > * get_event_listeners()
Definition: gcs_xcom_communication_interface.cc:82
Gcs_xcom_communication_protocol_changer m_protocol_changer
Protocol changer.
Definition: gcs_xcom_communication_interface.h:335
packet_recovery_result
Error code for the packet recovery proceess.
Definition: gcs_xcom_communication_interface.h:357
@ PACKET_UNEXPECTED_CARGO
@ PIPELINE_UNEXPECTED_OUTPUT
void cleanup_buffered_packets() override
Definition: gcs_xcom_communication_interface.cc:246
unsigned int m_gid_hash
Hash of the group.
Definition: gcs_xcom_communication_interface.h:332
std::pair< bool, std::future< void > > set_protocol_version(Gcs_protocol_version new_version) override
Modifies the GCS protocol version in use.
Definition: gcs_xcom_communication_interface.cc:625
int add_event_listener(const Gcs_communication_event_listener &event_listener) override
Registers an implementation of a Gcs_communication_event_listener that will receive Communication Eve...
Definition: gcs_xcom_communication_interface.cc:185
std::vector< std::pair< Gcs_packet, std::unique_ptr< Gcs_xcom_nodes > > > m_buffered_packets
Buffer that is used to store packets while the node is about to install a view and is running the sta...
Definition: gcs_xcom_communication_interface.h:326
Gcs_xcom_view_change_control_interface * m_view_control
Definition: gcs_xcom_communication_interface.h:313
Definition: gcs_xcom_notification.h:94
This class contains information on the configuration, i.e set of nodes or simply site definition.
Definition: gcs_xcom_group_member_information.h:391
Definition: gcs_xcom_proxy.h:52
This interface contains the public methods that the implementation of the Gcs_statistics_interface wi...
Definition: gcs_xcom_statistics_interface.h:39
Definition: gcs_xcom_state_exchange.h:716
enum_gcs_error
This enumeration describes errors which can occur during group communication operations.
Definition: gcs_types.h:41
Gcs_protocol_version
The GCS protocol versions.
Definition: gcs_types.h:128
static Gcs_xcom_engine * gcs_engine
Definition: gcs_xcom_interface.cc:144
std::unordered_set< Gcs_xcom_synode > Gcs_xcom_synode_set
Definition: gcs_xcom_synode.h:84
enum_transport_protocol
Enum that describes the available XCom Communication Stacks.
Definition: network_provider.h:45
required uint64 version
Definition: replication_group_member_actions.proto:41
Definition: mysqlslap.cc:238