![]() |
MySQL 26.7.0
Source Code Documentation
|
Interface class that all specializations of template <...> Basic_binlog_file_reader inherit from. More...
#include <binlog_reader.h>
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_reader & | operator= (IBasic_binlog_file_reader &)=delete |
| IBasic_binlog_file_reader & | operator= (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_event * | read_event_object ()=0 |
| Read the next event from the stream. More... | |
| virtual const mysql::binlog::event::Format_description_event & | format_description_event () const =0 |
| Return a pointer the currently used Format_description_log_event. More... | |
| virtual std::optional< Event_metadata > | read_event_metadata ()=0 |
| Reads event header metadata without updating position to the next header (see skip_event_payload) More... | |
| virtual Log_event * | read_event_payload (const Event_metadata &metadata)=0 |
| Reads event payload after header metadata has been read. More... | |
| virtual std::optional< Event_payload > | read_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... | |
Interface class that all specializations of template <...> Basic_binlog_file_reader inherit from.
|
default |
|
delete |
|
delete |
|
virtualdefault |
|
pure virtual |
Closes the reader.
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 >.
|
pure virtual |
Return a pointer the currently used Format_description_log_event.
The event is a member by this reader, so the caller must not use the returned reference after this reader has been deleted.
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 >.
|
pure virtual |
Return a string representing the error.
The return value is static memory that is never deallocated.
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 >.
|
pure virtual |
Return the type of error.
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 >.
|
pure virtual |
Return true if there was a previous error.
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 >.
|
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.
| [in] | file_name | name of the binlog file which will be opened. |
| [in] | offset | The position where it starts to read. |
| [out] | fdle | For returning an Format_description_log_event object. |
| false | Success |
| true | Error |
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 >.
|
delete |
|
delete |
|
pure virtual |
Return the current position in bytes, relative to the beginning of the file.
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 >.
|
pure virtual |
Reads event header metadata without updating position to the next header (see skip_event_payload)
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 >.
|
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.
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 >.
|
pure virtual |
Reads event payload after header metadata has been read.
Fills event data and decodes the event
| metadata | Metadata previously read (read_event_metadata) |
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 >.
|
pure virtual |
Reads raw payload after header metadata has been read.
Fills event data, skips decoding part
| metadata | Metadata previously read (read_event_metadata) |
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 >.
|
pure virtual |
Seek to a given position.
| pos | Position to seek to |
| false | Success |
| true | Seek not possible |
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 >.
|
pure virtual |
Skips event payload data.
Used to move reader position to the next header
| metadata | Metadata previously read (read_event_metadata) |
| false | Success |
| true | Error |
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 >.