MySQL  8.0.24
Source Code Documentation
binary_log::Transaction_payload_event Class Reference

This event is a wrapper event and encloses many other events. More...

#include <control_events.h>

Inheritance diagram for binary_log::Transaction_payload_event:
binary_log::Binary_log_event Transaction_payload_log_event

Public Types

enum  fields { OTW_PAYLOAD_HEADER_END_MARK = 0 , OTW_PAYLOAD_SIZE_FIELD = 1 , OTW_PAYLOAD_COMPRESSION_TYPE_FIELD = 2 , OTW_PAYLOAD_UNCOMPRESSED_SIZE_FIELD = 3 }
 The on-the-wire fields. More...
 
- Public Types inherited from binary_log::Binary_log_event
enum  enum_post_header_length {
  QUERY_HEADER_MINIMAL_LEN = (4 + 4 + 1 + 2) , QUERY_HEADER_LEN = (QUERY_HEADER_MINIMAL_LEN + 2) , STOP_HEADER_LEN = 0 , START_V3_HEADER_LEN = (2 + ST_SERVER_VER_LEN + 4) ,
  ROTATE_HEADER_LEN = 8 , INTVAR_HEADER_LEN = 0 , APPEND_BLOCK_HEADER_LEN = 4 , DELETE_FILE_HEADER_LEN = 4 ,
  RAND_HEADER_LEN = 0 , USER_VAR_HEADER_LEN = 0 , FORMAT_DESCRIPTION_HEADER_LEN = (START_V3_HEADER_LEN + 1 + LOG_EVENT_TYPES) , XID_HEADER_LEN = 0 ,
  BEGIN_LOAD_QUERY_HEADER_LEN = APPEND_BLOCK_HEADER_LEN , ROWS_HEADER_LEN_V1 = 8 , TABLE_MAP_HEADER_LEN = 8 , EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN = (4 + 4 + 4 + 1) ,
  EXECUTE_LOAD_QUERY_HEADER_LEN , INCIDENT_HEADER_LEN = 2 , HEARTBEAT_HEADER_LEN = 0 , IGNORABLE_HEADER_LEN = 0 ,
  ROWS_HEADER_LEN_V2 = 10 , TRANSACTION_CONTEXT_HEADER_LEN = 18 , VIEW_CHANGE_HEADER_LEN = 52 , XA_PREPARE_HEADER_LEN = 0 ,
  TRANSACTION_PAYLOAD_HEADER_LEN = 0
}
 The lengths for the fixed data part of each event. More...
 

Public Member Functions

 Transaction_payload_event (const char *payload, uint64_t payload_size)
 Creates Transaction_payload_event with the given data which has the given size. More...
 
 Transaction_payload_event (const char *payload, uint64_t payload_size, uint16_t compression_type, uint64_t uncompressed_size)
 Creates Transaction_payload_event with the given data which has the given size. More...
 
 Transaction_payload_event (const char *buf, const Format_description_event *fde)
 This constructor takes a raw buffer and a format descriptor event and decodes the buffer. More...
 
 ~Transaction_payload_event () override
 This destroys the transaction payload event. More...
 
void set_compression_type (transaction::compression::type type)
 Shall set the compression type used for the enclosed payload. More...
 
transaction::compression::type get_compression_type () const
 Shall return the compression type used for the enclosed payload. More...
 
void set_payload_size (uint64_t size)
 Shall set the size of the payload inside this event. More...
 
uint64_t get_payload_size () const
 Shall get the size of the payload inside this event. More...
 
void set_uncompressed_size (uint64_t size)
 Shall set the uncompressed size of the payload. More...
 
uint64_t get_uncompressed_size () const
 Shall get the uncompressed size of the event. More...
 
void set_payload (const char *data)
 Shall set the payload of the event. More...
 
const char * get_payload () const
 Shall get the payload of the event. More...
 
std::string to_string () const
 Shall return a textual representation of this event. More...
 
- Public Member Functions inherited from binary_log::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_eventoperator= (const Binary_log_event &)=default
 
Binary_log_eventoperator= (Binary_log_event &&)=default
 
enum Log_event_type get_event_type () const
 Helper method. More...
 
const Log_event_headerheader () const
 Return a const pointer to the header of the log event. More...
 
Log_event_headerheader ()
 Return a non-const pointer to the header of the log event. More...
 
const Log_event_footerfooter () const
 Return a const pointer to the footer of the log event. More...
 
Log_event_footerfooter ()
 Return a non-const pointer to the footer of the log event. More...
 
Event_readerreader ()
 Returns a reference to the event Event_reader object. More...
 

Static Public Attributes

static const unsigned short COMPRESSION_TYPE_MIN_LENGTH = 1
 
static const unsigned short COMPRESSION_TYPE_MAX_LENGTH = 9
 
static const unsigned short PAYLOAD_SIZE_MIN_LENGTH = 0
 
static const unsigned short PAYLOAD_SIZE_MAX_LENGTH = 9
 
static const unsigned short UNCOMPRESSED_SIZE_MIN_LENGTH = 0
 
static const unsigned short UNCOMPRESSED_SIZE_MAX_LENGTH = 9
 
static const int MAX_DATA_LENGTH
 
- Static Public Attributes inherited from binary_log::Binary_log_event
static const int LOG_EVENT_TYPES = (ENUM_END_EVENT - 1)
 

Protected Attributes

const char * m_payload {nullptr}
 The raw bytes which are the data that this event contains. More...
 
uint64_t m_payload_size {0}
 The size of the data. More...
 
transaction::compression::type m_compression_type
 If the data is compressed, which compression was used. More...
 
uint64_t m_uncompressed_size {0}
 The size of the data uncompressed. More...
 

Private Member Functions

Transaction_payload_eventoperator= (const Transaction_payload_event &)=delete
 
 Transaction_payload_event (const Transaction_payload_event &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from binary_log::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...
 

Detailed Description

This event is a wrapper event and encloses many other events.

It is mostly used for carrying compressed payloads as its content can be compressed, in which case, its metadata shall contain information about the compression metadata as well.

Member Enumeration Documentation

◆ fields

The on-the-wire fields.

Enumerator
OTW_PAYLOAD_HEADER_END_MARK 

Marks the end of the payload header.

OTW_PAYLOAD_SIZE_FIELD 

The payload field.

OTW_PAYLOAD_COMPRESSION_TYPE_FIELD 

The compression type field.

OTW_PAYLOAD_UNCOMPRESSED_SIZE_FIELD 

The uncompressed size field.

Constructor & Destructor Documentation

◆ Transaction_payload_event() [1/4]

binary_log::Transaction_payload_event::Transaction_payload_event ( const Transaction_payload_event )
privatedelete

◆ Transaction_payload_event() [2/4]

binary_log::Transaction_payload_event::Transaction_payload_event ( const char *  payload,
uint64_t  payload_size 
)

Creates Transaction_payload_event with the given data which has the given size.

Parameters
payloadthe data that this event shall wrap.
payload_sizethe size of the payload.

The data shall not be compressed. However, there is no other validation that this is the case.

◆ Transaction_payload_event() [3/4]

binary_log::Transaction_payload_event::Transaction_payload_event ( const char *  payload,
uint64_t  payload_size,
uint16_t  compression_type,
uint64_t  uncompressed_size 
)

Creates Transaction_payload_event with the given data which has the given size.

The data provided may or may not have been compressed. In any case the compression_type must be set.

Parameters
payloadthe data that this event shall wrap.
payload_sizethe size of the payload.
compression_typethe compression type used for the data provided.
uncompressed_sizethe size of the data when uncompressed.

The data may or may not be compressed. There is no validation or check that it is or that the payload matches the metadata provided.

◆ Transaction_payload_event() [4/4]

binary_log::Transaction_payload_event::Transaction_payload_event ( const char *  buf,
const Format_description_event fde 
)

This constructor takes a raw buffer and a format descriptor event and decodes the buffer.

It populates this event metadata with the contents of the buffer.

Parameters
bufthe buffer to decode.
fdethe format description event used to decode the buffer.

◆ ~Transaction_payload_event()

binary_log::Transaction_payload_event::~Transaction_payload_event ( )
override

This destroys the transaction payload event.

Member Function Documentation

◆ get_compression_type()

transaction::compression::type binary_log::Transaction_payload_event::get_compression_type ( ) const
inline

Shall return the compression type used for the enclosed payload.

Returns
the compression type.

◆ get_payload()

const char* binary_log::Transaction_payload_event::get_payload ( ) const
inline

Shall get the payload of the event.

Returns
the payload of the event.

◆ get_payload_size()

uint64_t binary_log::Transaction_payload_event::get_payload_size ( ) const
inline

Shall get the size of the payload inside this event.

Returns
The payload size.

◆ get_uncompressed_size()

uint64_t binary_log::Transaction_payload_event::get_uncompressed_size ( ) const
inline

Shall get the uncompressed size of the event.

Returns
uncompressed_size.

◆ operator=()

Transaction_payload_event& binary_log::Transaction_payload_event::operator= ( const Transaction_payload_event )
privatedelete

◆ set_compression_type()

void binary_log::Transaction_payload_event::set_compression_type ( transaction::compression::type  type)
inline

Shall set the compression type used for the enclosed payload.

Parameters
typethe compression type.

◆ set_payload()

void binary_log::Transaction_payload_event::set_payload ( const char *  data)
inline

Shall set the payload of the event.

Parameters
datathe payload of the event.

◆ set_payload_size()

void binary_log::Transaction_payload_event::set_payload_size ( uint64_t  size)
inline

Shall set the size of the payload inside this event.

Parameters
sizeThe payload size.

◆ set_uncompressed_size()

void binary_log::Transaction_payload_event::set_uncompressed_size ( uint64_t  size)
inline

Shall set the uncompressed size of the payload.

Parameters
sizethe uncompressed size of the payload.

◆ to_string()

std::string binary_log::Transaction_payload_event::to_string ( ) const

Shall return a textual representation of this event.

Returns
a textial representation of this event.

Member Data Documentation

◆ COMPRESSION_TYPE_MAX_LENGTH

const unsigned short binary_log::Transaction_payload_event::COMPRESSION_TYPE_MAX_LENGTH = 9
static

◆ COMPRESSION_TYPE_MIN_LENGTH

const unsigned short binary_log::Transaction_payload_event::COMPRESSION_TYPE_MIN_LENGTH = 1
static

◆ m_compression_type

transaction::compression::type binary_log::Transaction_payload_event::m_compression_type
protected
Initial value:

If the data is compressed, which compression was used.

For now, the only compressors supported are: ZSTD or NONE.

NONE means no compression at all. ZSTD means using ZSTD compression.

◆ m_payload

const char* binary_log::Transaction_payload_event::m_payload {nullptr}
protected

The raw bytes which are the data that this event contains.

◆ m_payload_size

uint64_t binary_log::Transaction_payload_event::m_payload_size {0}
protected

The size of the data.

◆ m_uncompressed_size

uint64_t binary_log::Transaction_payload_event::m_uncompressed_size {0}
protected

The size of the data uncompressed.

This is the same as m_payload_size if there is no compression involved.

◆ MAX_DATA_LENGTH

const int binary_log::Transaction_payload_event::MAX_DATA_LENGTH
static
Initial value:
static const unsigned short UNCOMPRESSED_SIZE_MAX_LENGTH
Definition: control_events.h:774
static const unsigned short PAYLOAD_SIZE_MAX_LENGTH
Definition: control_events.h:772
static const unsigned short COMPRESSION_TYPE_MAX_LENGTH
Definition: control_events.h:770

◆ PAYLOAD_SIZE_MAX_LENGTH

const unsigned short binary_log::Transaction_payload_event::PAYLOAD_SIZE_MAX_LENGTH = 9
static

◆ PAYLOAD_SIZE_MIN_LENGTH

const unsigned short binary_log::Transaction_payload_event::PAYLOAD_SIZE_MIN_LENGTH = 0
static

◆ UNCOMPRESSED_SIZE_MAX_LENGTH

const unsigned short binary_log::Transaction_payload_event::UNCOMPRESSED_SIZE_MAX_LENGTH = 9
static

◆ UNCOMPRESSED_SIZE_MIN_LENGTH

const unsigned short binary_log::Transaction_payload_event::UNCOMPRESSED_SIZE_MIN_LENGTH = 0
static

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