MySQL 9.1.0
Source Code Documentation
|
This class is responsible for controlling message fragmentation and bundling and produces messages with the following format: More...
#include <gcs_message_stage_split.h>
Public Member Functions | |
Gcs_split_header_v2 ()=default | |
Gcs_split_header_v2 (const Gcs_sender_id &sender_id, Gcs_message_id message_id, unsigned int num_messages, unsigned int message_part_id, unsigned long long payload_length) noexcept | |
std::unique_ptr< Gcs_stage_metadata > | clone () override |
Creates a deep copy of this object. More... | |
void | set_sender_id (const Gcs_sender_id &sender_id) |
Set the sender identifier. More... | |
const Gcs_sender_id & | get_sender_id () const |
Return the sender identifier. More... | |
void | set_message_id (Gcs_message_id message_id) |
Set the message identifier. More... | |
Gcs_message_id | get_message_id () const |
Return the message identifier. More... | |
void | set_num_messages (unsigned int num_messages) |
Set the number of messages bundled together. More... | |
unsigned int | get_num_messages () const |
Return the number of messages bundled together. More... | |
void | set_message_part_id (unsigned int message_part_id) |
Set the part that identifies this message. More... | |
unsigned int | get_message_part_id () const |
Return the part that identifies this message. More... | |
void | set_payload_length (unsigned long long payload_length) |
Set the payload length. More... | |
unsigned long long | get_payload_length () const |
Return the payload length. More... | |
unsigned long long | decode (const unsigned char *buffer) override |
Decodes the contents of the buffer and sets the field values according to the values decoded. More... | |
unsigned long long | encode (unsigned char *buffer) const override |
Encode the contents of this instance into the buffer. More... | |
unsigned long long | calculate_encode_length () const override |
Calculate the length used to store the stage header information. More... | |
void | dump (std::ostringstream &output) const override |
Create a string representation of the header to be logged. More... | |
Public Member Functions inherited from Gcs_stage_metadata | |
Gcs_stage_metadata ()=default | |
virtual | ~Gcs_stage_metadata () |
Gcs_stage_metadata (const Gcs_stage_metadata &)=default | |
Gcs_stage_metadata & | operator= (const Gcs_stage_metadata &)=default |
Gcs_stage_metadata (Gcs_stage_metadata &&)=default | |
Gcs_stage_metadata & | operator= (Gcs_stage_metadata &&)=default |
Static Public Attributes | |
static const unsigned short | WIRE_HD_NUM_MESSAGES_SIZE = 4 |
On-the-wire field size for the number of messages. More... | |
static const unsigned short | WIRE_HD_SENDER_ID_SIZE = 8 |
On-the-wire field size for the sender identification size. More... | |
static const unsigned short | WIRE_HD_MESSAGE_ID_SIZE = 8 |
On-the-wire field size for the message sequence (i.e. More... | |
static const unsigned short | WIRE_HD_MESSAGE_PART_ID_SIZE = 4 |
On-the-wire field size for the message part sequence (i.e. More... | |
static const unsigned short | WIRE_HD_PAYLOAD_SIZE = 8 |
On-the-wire field size for payload length. More... | |
Static Private Member Functions | |
static unsigned long long | fixed_encode_length () |
Helper method to calculate the length used to store the stage header information. More... | |
Private Attributes | |
Gcs_sender_id | m_sender_id |
Uniquely identify the sender which the message belongs to. More... | |
Gcs_message_id | m_message_id {0} |
Uniquely identify the message so that we can reassemble split messages. More... | |
unsigned int | m_num_messages {1} |
Determine the number of original messages that are included here. More... | |
unsigned int | m_message_part_id {0} |
Determine the part in the original message that the current payload corresponds to. More... | |
unsigned long long | m_payload_length {0} |
Size of the current payload which is a full message or part of a message. More... | |
This class is responsible for controlling message fragmentation and bundling and produces messages with the following format:
. Sender Id - Member Identifier (i.e. incarnation UUID) that is used to uniquely identify the original sender.
. Message Id - Message Identifier (i.e. transaction counter) that is used to uniquely identify the original message.
. Part Id - Fragment of the original message that the payload corresponds to.
. Num Msg - The total number of messages that together compose the original message.
. Size - The payload size that is being carried on by this message.
. Payload - Payload that corresponds to the part of the original message that it is carrying on.
|
explicitdefault |
|
inlineexplicitnoexcept |
|
inlineoverridevirtual |
Calculate the length used to store the stage header information.
Implements Gcs_stage_metadata.
|
inlineoverridevirtual |
Creates a deep copy of this object.
Implements Gcs_stage_metadata.
|
overridevirtual |
Decodes the contents of the buffer and sets the field values according to the values decoded.
The buffer MUST be encoded in little endian format.
buffer | The buffer to decode from. |
Implements Gcs_stage_metadata.
|
overridevirtual |
Create a string representation of the header to be logged.
output | Reference to the output stream where the string will be created. |
Implements Gcs_stage_metadata.
|
overridevirtual |
Encode the contents of this instance into the buffer.
The encoding SHALL be done in little endian format.
buffer | The buffer to encode to. |
Implements Gcs_stage_metadata.
|
inlinestaticprivate |
Helper method to calculate the length used to store the stage header information.
|
inline |
Return the message identifier.
|
inline |
Return the part that identifies this message.
|
inline |
Return the number of messages bundled together.
|
inline |
Return the payload length.
|
inline |
Return the sender identifier.
|
inline |
Set the message identifier.
message_id | Message identification. |
|
inline |
Set the part that identifies this message.
message_part_id | Part that identifies this message. |
|
inline |
Set the number of messages bundled together.
num_messages | Number of messages bundled together. |
|
inline |
Set the payload length.
payload_length | Payload buffer length. |
|
inline |
Set the sender identifier.
sender_id | Sender identification. |
|
private |
Uniquely identify the message so that we can reassemble split messages.
|
private |
Determine the part in the original message that the current payload corresponds to.
Note that the value starts at 0.
|
private |
Determine the number of original messages that are included here.
|
private |
Size of the current payload which is a full message or part of a message.
|
private |
Uniquely identify the sender which the message belongs to.
|
static |
On-the-wire field size for the message sequence (i.e.
identification).
|
static |
On-the-wire field size for the message part sequence (i.e.
identification).
|
static |
On-the-wire field size for the number of messages.
|
static |
On-the-wire field size for payload length.
|
static |
On-the-wire field size for the sender identification size.