MySQL 8.4.0
Source Code Documentation
mysql::binlog::event::codecs::binary::Transaction_payload Class Reference

Binary codec for the transaction payload log event. More...

#include <binary.h>

Inheritance diagram for mysql::binlog::event::codecs::binary::Transaction_payload:
[legend]

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 Member Functions

 Transaction_payload ()=default
 
std::pair< std::size_t, bool > decode (const unsigned char *from, std::size_t size, Binary_log_event &to) const override
 This member function shall decode the contents of the buffer provided and fill in the event referenced. More...
 
std::pair< std::size_t, bool > encode (const Binary_log_event &from, unsigned char *to, std::size_t size) const override
 This member function shall encode the contents of the event referenced and store the result in the buffer provided. More...
 
- Public Member Functions inherited from mysql::binlog::event::codecs::binary::Base_codec
 Base_codec ()=default
 
 Base_codec (Base_codec &&) noexcept=default
 
Base_codecoperator= (Base_codec &&) noexcept=default
 
 Base_codec (const Base_codec &) noexcept=default
 
Base_codecoperator= (const Base_codec &)=default
 
 ~Base_codec () override=default
 
- Public Member Functions inherited from mysql::binlog::event::codecs::Codec
virtual ~Codec ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from mysql::binlog::event::codecs::binary::Base_codec
Event_readerreader ()
 
- Protected Attributes inherited from mysql::binlog::event::codecs::binary::Base_codec
Event_readerm_reader = nullptr
 

Detailed Description

Binary codec for the transaction payload log event.

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()

mysql::binlog::event::codecs::binary::Transaction_payload::Transaction_payload ( )
default

Member Function Documentation

◆ decode()

std::pair< std::size_t, bool > mysql::binlog::event::codecs::binary::Transaction_payload::decode ( const unsigned char *  from,
std::size_t  size,
Binary_log_event to 
) const
overridevirtual

This member function shall decode the contents of the buffer provided and fill in the event referenced.

This is the decoder member function for the TLV encoded set of values for the Transaction payload event.

Note that the event provided needs to be of type TRANSACTION_PAYLOAD_EVENT.

Parameters
fromthe buffer to decode
sizethe size of the buffer to decode.
tothe event to store the decoded information into.
Returns
a pair containing the amount of bytes decoded and whether there was an error or not. False if no error, true otherwise.

Note that the log event must have the appropriate type code: TRANSACTION_PAYLOAD_EVENT to be compatible with this specific decoder. If it is not, an error shall be returned

Parameters
fromthe buffer to decode from.
sizethe buffer size.
toThe log event to decode to.
Returns
a pair containing the number of bytes decoded and whether there was an error or not. False if no error, true otherwise.

Implements mysql::binlog::event::codecs::binary::Base_codec.

◆ encode()

std::pair< std::size_t, bool > mysql::binlog::event::codecs::binary::Transaction_payload::encode ( const Binary_log_event from,
unsigned char *  to,
std::size_t  size 
) const
overridevirtual

This member function shall encode the contents of the event referenced and store the result in the buffer provided.

This is the encoder member function for the TLV encoded set of values for the Transaction payload event.

Note that the event referenced needs to be of type TRANSACTION_PAYLOAD_EVENT.

Parameters
fromthe event to encode.
tothe buffer where to store the encoded event.
sizethe size of the buffer.
Returns
a pair containing the amount of bytes encoded and whether there was an error or not.

Note that the log event must have the appropriate type code: TRANSACTION_PAYLOAD_EVENT to be compatible with this specific enccoder. If it is not, an error shall be returned

Parameters
fromThe log event to decode to.
tothe buffer to decode from.
sizethe buffer size.
Returns
a pair containing the number of bytes decoded and whether there was an error or not. False if no error, true otherwise.

Implements mysql::binlog::event::codecs::binary::Base_codec.


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