24#ifndef BINLOG_DECOMPRESSING_EVENT_OBJECT_ISTREAM_H_
25#define BINLOG_DECOMPRESSING_EVENT_OBJECT_ISTREAM_H_
75 using Tple_ptr_t = std::shared_ptr<const Transaction_payload_log_event>;
107 const Tple_ptr_t &transaction_payload_log_event,
166 explicit operator bool()
const;
274 template <
class Event_ref_or_ptr>
276 const Event_ref_or_ptr &ownership_tple) {
Interface class that all specializations of template <...> Basic_binlog_file_reader inherit from.
Definition: binlog_reader.h:236
Definition: log_event.h:3879
Stream class that yields Log_event objects from a source.
Definition: decompressing_event_object_istream.h:68
~Decompressing_event_object_istream()
Definition: decompressing_event_object_istream.cc:64
Buffer_stream_t::Buffer_view_t Buffer_view_t
Definition: decompressing_event_object_istream.h:72
Decompressing_event_object_istream(IBasic_binlog_file_reader &reader, const Memory_resource_t &memory_resource=Memory_resource_t())
Construct stream over a file, decompressing payload events.
Definition: decompressing_event_object_istream.cc:33
bool decode_from_buffer(Buffer_view_t &buffer, Event_ptr_t &out)
Worker that deserializes an event from the buffer.
Definition: decompressing_event_object_istream.cc:162
Status_t get_status() const
Return the status.
Definition: decompressing_event_object_istream.cc:97
const mysql::binlog::event::Format_description_event & Fde_ref_t
Definition: decompressing_event_object_istream.h:76
Status_t m_status
Status.
Definition: decompressing_event_object_istream.h:206
void begin_payload_event(const Transaction_payload_log_event &tple)
Prepare to unfold a given Transaction_payload_log_event by setting state variables and creating the P...
Definition: decompressing_event_object_istream.h:249
Read_status read_from_payload_stream(Event_ptr_t &out)
Read and decode next event from the Payload_log_event stream.
Definition: decompressing_event_object_istream.cc:192
void do_begin_payload_event(const Transaction_payload_log_event &tple, const Event_ref_or_ptr &ownership_tple)
Worker function implementing both forms of begin_payload_event.
Definition: decompressing_event_object_istream.h:275
my_off_t m_transaction_payload_event_offset
end_log_pos for the currently processed TPLE, if any
Definition: decompressing_event_object_istream.h:220
std::shared_ptr< const Transaction_payload_log_event > Tple_ptr_t
Definition: decompressing_event_object_istream.h:75
raii::Targeted_stringstream error_stream(Status_t status)
Report an error.
Definition: decompressing_event_object_istream.cc:135
my_off_t m_event_position
Position of last event.
Definition: decompressing_event_object_istream.h:208
bool m_verify_checksum
Whether we should verify checksum. Unused!
Definition: decompressing_event_object_istream.h:200
std::shared_ptr< Log_event > Event_ptr_t
Definition: decompressing_event_object_istream.h:74
Decompressing_event_object_istream & operator=(Decompressing_event_object_istream &)=delete
Grow_calculator_t m_grow_calculator
Policy for growing buffers in the decompressing stream.
Definition: decompressing_event_object_istream.h:216
int m_embedded_event_number
0 when not processing a TPLE; N>0 when positioned before the Nth embedded event of a TPLE.
Definition: decompressing_event_object_istream.h:223
void set_verify_checksum(bool verify_checksum=true)
Specify whether checksums shall be verified or not.
Definition: decompressing_event_object_istream.cc:73
std::unique_ptr< Buffer_stream_t > m_buffer_istream
The decompression stream; non-null while we are positioned in a TPLE.
Definition: decompressing_event_object_istream.h:218
IBasic_binlog_file_reader * m_binlog_reader
Stream of events to read from.
Definition: decompressing_event_object_istream.h:198
bool operator!() const
Indicate if EOF or error has happened.
Definition: decompressing_event_object_istream.cc:80
void begin_payload_event(const Tple_ptr_t &tple)
Prepare to unfold a given Transaction_payload_log_event by setting state variables and creating the P...
Definition: decompressing_event_object_istream.h:260
mysql::allocators::Memory_resource Memory_resource_t
Definition: decompressing_event_object_istream.h:79
Read_status
Status from read_from_payload_stream.
Definition: decompressing_event_object_istream.h:302
bool m_end
True if we have reached EOF, false otherwise.
Definition: decompressing_event_object_istream.h:204
void set_grow_calculator(const Grow_calculator_t &grow_calculator)
Set the Grow_calculator for the internal event buffer.
Definition: decompressing_event_object_istream.cc:157
std::function< Fde_ref_t()> m_get_format_description_event
Return the current FDE.
Definition: decompressing_event_object_istream.h:228
Decompressing_event_object_istream & operator>>(Event_ptr_t &out)
Read an event from the stream.
Definition: decompressing_event_object_istream.cc:264
Buffer_stream_t::Buffer_ptr_t Buffer_ptr_t
Definition: decompressing_event_object_istream.h:73
Decompressing_event_object_istream(Decompressing_event_object_istream &&)=delete
bool has_error() const
Return true if an error has happened.
Definition: decompressing_event_object_istream.cc:89
const Grow_calculator_t & get_grow_calculator() const
Return const reference to Grow_calculator to the internal event buffer.
Definition: decompressing_event_object_istream.cc:153
std::string m_error_str
Error from last operation.
Definition: decompressing_event_object_istream.h:202
Decompressing_event_object_istream(Decompressing_event_object_istream &)=delete
bool m_outstanding_error
True if a read has failed but neither get_error_str nor has_error has been called.
Definition: decompressing_event_object_istream.h:212
Memory_resource_t m_memory_resource
Definition: decompressing_event_object_istream.h:225
bool read_from_binlog_stream(Event_ptr_t &out)
Read and decode the next event from the binlog stream.
Definition: decompressing_event_object_istream.cc:228
std::string get_error_str() const
Return a message describing the last error.
Definition: decompressing_event_object_istream.cc:82
Decompressing_event_object_istream & operator=(Decompressing_event_object_istream &&)=delete
Polymorphism-free memory resource class with custom allocator and deallocator functions.
Definition: memory_resource.h:88
const Log_event_header * header() const
Return a const pointer to the header of the log event.
Definition: binlog_event.h:951
Stream class that yields a stream of byte buffers, each holding the raw decompressed data of one even...
Definition: payload_event_buffer_istream.h:58
Managed_buffer_t::Buffer_view_t Buffer_view_t
Definition: payload_event_buffer_istream.h:67
mysql::containers::buffers::Grow_calculator Grow_calculator_t
Definition: payload_event_buffer_istream.h:62
std::shared_ptr< Buffer_view_t > Buffer_ptr_t
Definition: payload_event_buffer_istream.h:68
Description of a heuristic to determine how much memory to allocate.
Definition: grow_calculator.h:68
Like std::stringstream, copying to a given target string at destruction.
Definition: targeted_stringstream.h:48
Class that wraps resources in a polymorphic manner.
#define DBUG_TRACE
Definition: my_dbug.h:146
ulonglong my_off_t
Definition: my_inttypes.h:72
Decompress_status
Definition: decompress_status.h:32
@ success
Decompression succeeded.
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
#define NODISCARD
The function attribute [[NODISCARD]] is a replacement for [[nodiscard]] to workaround a gcc bug.
Definition: nodiscard.h:47
Stream class that yields decompressed event byte buffers from a Transaction_payload_log_event.
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:61