MySQL 26.7.0
Source Code Documentation
IBasic_binlog_file_reader Class Referenceabstract

Interface class that all specializations of template <...> Basic_binlog_file_reader inherit from. More...

#include <binlog_reader.h>

Inheritance diagram for IBasic_binlog_file_reader:
[legend]

Public Member Functions

 IBasic_binlog_file_reader ()=default
 
 IBasic_binlog_file_reader (IBasic_binlog_file_reader &)=delete
 
 IBasic_binlog_file_reader (IBasic_binlog_file_reader &&)=delete
 
IBasic_binlog_file_readeroperator= (IBasic_binlog_file_reader &)=delete
 
IBasic_binlog_file_readeroperator= (IBasic_binlog_file_reader &&)=delete
 
virtual ~IBasic_binlog_file_reader ()=default
 
virtual bool open (const char *file_name, my_off_t offset=0, Format_description_log_event **fdle=nullptr)=0
 Open a binlog file and set read position to offset. More...
 
virtual void close ()=0
 Closes the reader. More...
 
virtual bool has_fatal_error () const =0
 Return true if there was a previous error. More...
 
virtual Binlog_read_error::Error_type get_error_type () const =0
 Return the type of error. More...
 
virtual const char * get_error_str () const =0
 Return a string representing the error. More...
 
virtual my_off_t position () const =0
 Return the current position in bytes, relative to the beginning of the file. More...
 
virtual bool seek (my_off_t pos)=0
 Seek to a given position. More...
 
virtual Log_eventread_event_object ()=0
 Read the next event from the stream. More...
 
virtual const mysql::binlog::event::Format_description_eventformat_description_event () const =0
 Return a pointer the currently used Format_description_log_event. More...
 
virtual std::optional< Event_metadataread_event_metadata ()=0
 Reads event header metadata without updating position to the next header (see skip_event_payload) More...
 
virtual Log_eventread_event_payload (const Event_metadata &metadata)=0
 Reads event payload after header metadata has been read. More...
 
virtual std::optional< Event_payloadread_payload (const Event_metadata &metadata)=0
 Reads raw payload after header metadata has been read. More...
 
virtual bool skip_event_payload (const Event_metadata &metadata)=0
 Skips event payload data. More...
 

Detailed Description

Interface class that all specializations of template <...> Basic_binlog_file_reader inherit from.

Constructor & Destructor Documentation

◆ IBasic_binlog_file_reader() [1/3]

IBasic_binlog_file_reader::IBasic_binlog_file_reader ( )
default

◆ IBasic_binlog_file_reader() [2/3]

IBasic_binlog_file_reader::IBasic_binlog_file_reader ( IBasic_binlog_file_reader )
delete

◆ IBasic_binlog_file_reader() [3/3]

IBasic_binlog_file_reader::IBasic_binlog_file_reader ( IBasic_binlog_file_reader &&  )
delete

◆ ~IBasic_binlog_file_reader()

virtual IBasic_binlog_file_reader::~IBasic_binlog_file_reader ( )
virtualdefault

Member Function Documentation

◆ close()

◆ format_description_event()

virtual const mysql::binlog::event::Format_description_event & IBasic_binlog_file_reader::format_description_event ( ) const
pure virtual

◆ get_error_str()

◆ get_error_type()

◆ has_fatal_error()

◆ open()

virtual bool IBasic_binlog_file_reader::open ( const char *  file_name,
my_off_t  offset = 0,
Format_description_log_event **  fdle = nullptr 
)
pure virtual

Open a binlog file and set read position to offset.

It will read and store Format_description_event automatically if offset is bigger than current position and fde is nullptr. Otherwise fde is use instead of finding fde from the file if fde is not null.

Parameters
[in]file_namename of the binlog file which will be opened.
[in]offsetThe position where it starts to read.
[out]fdleFor returning an Format_description_log_event object.
Return values
falseSuccess
trueError

Implemented in Basic_binlog_file_reader< IFILE, EVENT_DATA_ISTREAM, EVENT_OBJECT_ISTREAM, ALLOCATOR >, Basic_binlog_file_reader< Relaylog_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Default_binlog_event_allocator >, and Basic_binlog_file_reader< Prefetched_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Default_binlog_event_allocator >.

◆ operator=() [1/2]

IBasic_binlog_file_reader & IBasic_binlog_file_reader::operator= ( IBasic_binlog_file_reader &&  )
delete

◆ operator=() [2/2]

IBasic_binlog_file_reader & IBasic_binlog_file_reader::operator= ( IBasic_binlog_file_reader )
delete

◆ position()

◆ read_event_metadata()

virtual std::optional< Event_metadata > IBasic_binlog_file_reader::read_event_metadata ( )
pure virtual

◆ read_event_object()

virtual Log_event * IBasic_binlog_file_reader::read_event_object ( )
pure virtual

Read the next event from the stream.

This function creates the object with "new". It is the caller's responsibility to delete it.

Returns
Log_event on success, nullptr on error. More information about the error can be found using get_error_type and get_error_str.

Implemented in Basic_binlog_file_reader< IFILE, EVENT_DATA_ISTREAM, EVENT_OBJECT_ISTREAM, ALLOCATOR >, Basic_binlog_file_reader< Relaylog_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Default_binlog_event_allocator >, and Basic_binlog_file_reader< Prefetched_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Default_binlog_event_allocator >.

◆ read_event_payload()

virtual Log_event * IBasic_binlog_file_reader::read_event_payload ( const Event_metadata metadata)
pure virtual

Reads event payload after header metadata has been read.

Fills event data and decodes the event

Parameters
metadataMetadata previously read (read_event_metadata)
Returns
Log event read and decoded from the stream

Implemented in Basic_binlog_file_reader< IFILE, EVENT_DATA_ISTREAM, EVENT_OBJECT_ISTREAM, ALLOCATOR >, Basic_binlog_file_reader< Relaylog_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Default_binlog_event_allocator >, and Basic_binlog_file_reader< Prefetched_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Default_binlog_event_allocator >.

◆ read_payload()

virtual std::optional< Event_payload > IBasic_binlog_file_reader::read_payload ( const Event_metadata metadata)
pure virtual

Reads raw payload after header metadata has been read.

Fills event data, skips decoding part

Parameters
metadataMetadata previously read (read_event_metadata)
Returns
Log event read and decoded from the stream

Implemented in Basic_binlog_file_reader< IFILE, EVENT_DATA_ISTREAM, EVENT_OBJECT_ISTREAM, ALLOCATOR >, Basic_binlog_file_reader< Relaylog_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Default_binlog_event_allocator >, and Basic_binlog_file_reader< Prefetched_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Default_binlog_event_allocator >.

◆ seek()

◆ skip_event_payload()

virtual bool IBasic_binlog_file_reader::skip_event_payload ( const Event_metadata metadata)
pure virtual

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