MySQL 9.1.0
Source Code Documentation
|
Event that encloses all the events of a transaction. More...
#include <control_events.h>
Public Member Functions | |
Transaction_payload_event (const char *payload, uint64_t payload_size, uint16_t compression_type, uint64_t uncompressed_size) | |
Construct an object from the given fields. More... | |
Transaction_payload_event (const char *buf, const Format_description_event *fde) | |
Decode the event from a buffer. More... | |
~Transaction_payload_event () override | |
void | set_compression_type (mysql::binlog::event::compression::type type) |
Set the compression type used for the enclosed payload. More... | |
mysql::binlog::event::compression::type | get_compression_type () const |
void | set_payload_size (uint64_t size) |
Set the (compressed) size of the payload in this event. More... | |
uint64_t | get_payload_size () const |
void | set_uncompressed_size (uint64_t size) |
Set the uncompressed size of the payload. More... | |
uint64_t | get_uncompressed_size () const |
Return the alleged uncompressed size according to the field stored in the event. More... | |
void | set_payload (const char *data) |
Set the (possibly compressed) payload for the event. More... | |
const char * | get_payload () const |
void | set_payload (Buffer_sequence_view_t *buffer_sequence_view) |
Set the (possibly compressed) payload for the event. More... | |
std::string | to_string () const |
Public Member Functions inherited from mysql::binlog::event::Binary_log_event | |
virtual | ~Binary_log_event ()=0 |
Binary_log_event (const Binary_log_event &)=default | |
Binary_log_event (Binary_log_event &&)=default | |
Binary_log_event & | operator= (const Binary_log_event &)=default |
Binary_log_event & | operator= (Binary_log_event &&)=default |
enum Log_event_type | get_event_type () const |
Helper method. More... | |
const Log_event_header * | header () const |
Return a const pointer to the header of the log event. More... | |
Log_event_header * | header () |
Return a non-const pointer to the header of the log event. More... | |
const Log_event_footer * | footer () const |
Return a const pointer to the footer of the log event. More... | |
Log_event_footer * | footer () |
Return a non-const pointer to the footer of the log event. More... | |
Event_reader & | reader () |
Returns a reference to the event Event_reader object. More... | |
Static Public Attributes | |
static constexpr size_t | compression_type_max_length = 1 + 1 + 1 |
There are four fields: "compression type", "payload size", "uncompressed size", and "end mark". More... | |
static constexpr size_t | payload_size_max_length = 1 + 1 + 9 |
static constexpr size_t | uncompressed_size_max_length = 1 + 1 + 9 |
static constexpr size_t | end_mark_max_length = 1 |
static constexpr size_t | max_payload_data_header_length |
The maximum size of the "payload data header". More... | |
static constexpr size_t | max_length_of_all_headers |
The maximum size of all headers, i.e., everything but the payload. More... | |
static constexpr size_t | max_payload_length |
The maximum length of the payload size, defined such that the total event size does not exceed max_log_event_size. More... | |
Static Public Attributes inherited from mysql::binlog::event::Binary_log_event | |
static const int | LOG_EVENT_TYPES = (ENUM_END_EVENT - 1) |
Protected Attributes | |
const char * | m_payload {nullptr} |
The compressed data, when entire payload is in one chunk. More... | |
Buffer_sequence_view_t * | m_buffer_sequence_view |
The compressed data, when payload consists of a sequence of buffers. More... | |
uint64_t | m_payload_size {0} |
The size of the compressed data. More... | |
mysql::binlog::event::compression::type | m_compression_type |
The compression algorithm that was used. More... | |
uint64_t | m_uncompressed_size {0} |
The uncompressed size of the data. More... | |
Private Member Functions | |
Transaction_payload_event & | operator= (const Transaction_payload_event &)=delete |
Transaction_payload_event (const Transaction_payload_event &)=delete | |
Additional Inherited Members | |
Protected Member Functions inherited from mysql::binlog::event::Binary_log_event | |
Binary_log_event (Log_event_type type_code) | |
This constructor is used to initialize the type_code of header object m_header. More... | |
Binary_log_event (const char **buf, const Format_description_event *fde) | |
This constructor will create a new object of Log_event_header and initialize the variable m_header, which in turn will be used to initialize Log_event's member common_header. More... | |
Event that encloses all the events of a transaction.
It is used for carrying compressed payloads, and contains compression metadata.
using mysql::binlog::event::Transaction_payload_event::Buffer_sequence_view_t = mysql::containers::buffers::Buffer_sequence_view<> |
|
privatedelete |
mysql::binlog::event::Transaction_payload_event::Transaction_payload_event | ( | const char * | payload, |
uint64_t | payload_size, | ||
uint16_t | compression_type, | ||
uint64_t | uncompressed_size | ||
) |
Construct an object from the given fields.
payload | The (compressed) payload data. |
payload_size | The size of payload in bytes. |
compression_type | the compression type that was used to compress payload . |
uncompressed_size | the size of the data when uncompressed. |
The function does not validate that the payload matches the metadata provided.
mysql::binlog::event::Transaction_payload_event::Transaction_payload_event | ( | const char * | buf, |
const Format_description_event * | fde | ||
) |
Decode the event from a buffer.
buf | The buffer to decode. |
fde | The format description event used to decode the buffer. |
|
overridedefault |
|
inline |
|
inline |
|
inline |
|
inline |
Return the alleged uncompressed size according to the field stored in the event.
This cannot be trusted; the actual size can only be computed by decompressing the event.
|
privatedelete |
|
inline |
Set the compression type used for the enclosed payload.
type | the compression type. |
void mysql::binlog::event::Transaction_payload_event::set_payload | ( | Buffer_sequence_view_t * | buffer_sequence_view | ) |
Set the (possibly compressed) payload for the event.
The payload is given as a Buffer_sequence_view. The ownership of the data remains with the caller; the caller must ensure that the iterators remain valid for as long as this event needs them.
buffer_sequence_view | Container holding the data. |
|
inline |
Set the (possibly compressed) payload for the event.
The ownership and responsibility to destroy the data is transferred to the event.
data | The payload of the event. |
|
inline |
Set the (compressed) size of the payload in this event.
size | The compressed size of the payload. |
|
inline |
Set the uncompressed size of the payload.
size | The uncompressed size of the payload. |
std::string mysql::binlog::event::Transaction_payload_event::to_string | ( | ) | const |
|
staticconstexpr |
There are four fields: "compression type", "payload size", "uncompressed size", and "end mark".
Each of the three first fields is stored as a triple, where:
So:
|
staticconstexpr |
|
protected |
The compressed data, when payload consists of a sequence of buffers.
|
protected |
The compression algorithm that was used.
|
protected |
The compressed data, when entire payload is in one chunk.
|
protected |
The size of the compressed data.
|
protected |
The uncompressed size of the data.
This is the same as m_payload_size
if the algorithms is NONE.
|
staticconstexpr |
The maximum size of all headers, i.e., everything but the payload.
This includes common-header, post-header, and payload data header.
|
staticconstexpr |
The maximum size of the "payload data header".
Any log event consists of the common-header (19 bytes, same format for all event types), followed by a post-header (size defined per event type; 0 for payload events), followed by data (variable length and defined by each event type). For payload events, the data contains a payload data header (these 4 fields), followed by the payload (compressed data).
|
staticconstexpr |
The maximum length of the payload size, defined such that the total event size does not exceed max_log_event_size.
|
staticconstexpr |
|
staticconstexpr |