24#ifndef GCS_MESSAGE_STAGE_SPLIT_H
25#define GCS_MESSAGE_STAGE_SPLIT_H
31#include <unordered_map>
102 "The m_message_id size does not match the storage capacity");
109 "The m_num_messages size does not match the storage capacity");
118 "The m_message_part_id size does not match the storage capacity");
125 "The m_payload_len size does not match the storage capacity");
132 unsigned int num_messages,
133 unsigned int message_part_id,
134 unsigned long long payload_length) noexcept
141 std::unique_ptr<Gcs_stage_metadata>
clone()
override {
220 unsigned long long decode(
const unsigned char *
buffer)
override;
229 unsigned long long encode(
unsigned char *
buffer)
const override;
260 std::unordered_map<Gcs_message_id, Gcs_packets_list>;
262 std::unordered_map<Gcs_sender_id, Gcs_packets_per_content>;
275 uint64_t
const &original_payload_size)
const override;
321 unsigned long long split_threshold)
386 Gcs_packet &&packet,
unsigned int const &nr_fragments)
const;
389 unsigned int const &fragment_part_id,
Gcs_packet const &other_fragment,
390 unsigned char const *
const original_payload_pointer,
391 unsigned long long const &fragment_size)
const;
432 unsigned long long split_threshold)
It represents the identity of a group member within a certain group.
Definition: gcs_member_identifier.h:40
Definition: gcs_message_stage_split.h:264
~Gcs_message_stage_split_v2() override
Definition: gcs_message_stage_split.h:326
static constexpr unsigned long long DEFAULT_THRESHOLD
Default split threshold.
Definition: gcs_message_stage_split.h:269
std::pair< bool, Gcs_packet > create_fragment(unsigned int const &fragment_part_id, Gcs_packet const &other_fragment, unsigned char const *const original_payload_pointer, unsigned long long const &fragment_size) const
Definition: gcs_message_stage_split.cc:374
std::pair< bool, std::vector< Gcs_packet > > create_fragments(Gcs_packet &&packet, unsigned int const &nr_fragments) const
Definition: gcs_message_stage_split.cc:278
std::unique_ptr< Gcs_stage_metadata > get_stage_header() override
Definition: gcs_message_stage_split.cc:216
bool update_members_information(const Gcs_member_identifier &me, const Gcs_xcom_nodes &xcom_nodes) override
Update the list of members in the group as this is required to process split messages.
Definition: gcs_message_stage_split.cc:133
void apply_transformation_single_fragment(Gcs_packet &packet) const
Definition: gcs_message_stage_split.cc:251
Gcs_sender_id m_sender_id
Unique sender identifier that is dynamically generated when a node rejoins the group.
Definition: gcs_message_stage_split.h:300
unsigned long long m_split_threshold
This marks the threshold in bytes above which a message shall be split.
Definition: gcs_message_stage_split.h:305
std::pair< bool, Gcs_packet > reassemble_fragments(Gcs_packets_list &fragments) const
Reassembles the given fragment list into the original, whole packet.
Definition: gcs_message_stage_split.cc:536
void insert_sender(const Gcs_sender_id &sender_id)
Insert a sender into the mapping that keeps track of sliced packets.
Definition: gcs_message_stage_split.cc:686
bool is_final_fragment(Gcs_split_header_v2 const &fragment_header) const
Definition: gcs_message_stage_split.cc:487
Gcs_message_stage_split_v2(bool enabled, unsigned long long split_threshold)
Creates an instance of the stage.
Definition: gcs_message_stage_split.h:320
Gcs_message_stage::stage_status skip_revert(const Gcs_packet &packet) const override
Check if the revert operation which affects incoming packets should be executed (i....
Definition: gcs_message_stage_split.cc:626
std::atomic< Gcs_message_id > m_next_message_number
Unique message identifier per sender.
Definition: gcs_message_stage_split.h:310
Gcs_message_stage::stage_status skip_apply(uint64_t const &original_payload_size) const override
Check if the apply operation which affects outgoing packets should be executed (i....
Definition: gcs_message_stage_split.cc:181
Gcs_packets_list get_fragments(Gcs_split_header_v2 const &fragment_header)
Fetch the fragments associated with the given metadata.
Definition: gcs_message_stage_split.cc:519
std::pair< bool, std::vector< Gcs_packet > > apply_transformation(Gcs_packet &&packet) override
Implements the logic of this stage's transformation to the packet, and returns a set of one,...
Definition: gcs_message_stage_split.cc:225
Gcs_xcom_synode_set get_snapshot() const override
Definition: gcs_message_stage_split.cc:694
bool insert_fragment(Gcs_packet &&packet)
Insert a packet into the mapping that keeps track of fragments.
Definition: gcs_message_stage_split.cc:631
Stage_code get_stage_code() const override
Return the stage code.
Definition: gcs_message_stage_split.h:331
std::pair< Gcs_pipeline_incoming_result, Gcs_packet > revert_transformation(Gcs_packet &&packet) override
Implements the logic to revert this stage's transformation to the packet, and returns one,...
Definition: gcs_message_stage_split.cc:429
bool unknown_sender(Gcs_split_header_v2 const &fragment_header) const
Definition: gcs_message_stage_split.cc:480
void remove_sender(const Gcs_sender_id &sender_id)
Remove a sender from the mapping that keeps track of sliced packets.
Definition: gcs_message_stage_split.cc:706
Gcs_packets_per_sender m_packets_per_source
Definition: gcs_message_stage_split.h:294
void set_threshold(unsigned long long split_threshold)
Sets the threshold in bytes after which messages are split.
Definition: gcs_message_stage_split.h:350
Definition: gcs_message_stage_split.h:422
~Gcs_message_stage_split_v3() override
Definition: gcs_message_stage_split.h:435
Gcs_message_stage_split_v3(bool enabled, unsigned long long split_threshold)
Creates an instance of the stage.
Definition: gcs_message_stage_split.h:431
Stage_code get_stage_code() const override
Return the stage code.
Definition: gcs_message_stage_split.h:440
This is a stage in the pipeline that processes messages when they are put through the send and receiv...
Definition: gcs_message_stages.h:82
stage_status
Definition: gcs_message_stages.h:84
This class is an abstraction for the packet concept.
Definition: gcs_internal_message.h:58
This class contains information on the configuration, i.e set of nodes or simply site definition.
Definition: gcs_xcom_group_member_information.h:391
std::unordered_map< Gcs_message_id, Gcs_packets_list > Gcs_packets_per_content
Definition: gcs_message_stage_split.h:260
unsigned long long Gcs_message_id
Definition: gcs_message_stage_split.h:37
uint64_t Gcs_sender_id
Definition: gcs_message_stage_split.h:38
std::unordered_map< Gcs_sender_id, Gcs_packets_per_content > Gcs_packets_per_sender
Definition: gcs_message_stage_split.h:262
std::vector< Gcs_packet > Gcs_packets_list
Definition: gcs_message_stage_split.h:258
std::unordered_set< Gcs_xcom_synode > Gcs_xcom_synode_set
Definition: gcs_xcom_synode.h:84
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2871
required bool enabled
Definition: replication_group_member_actions.proto:33