MySQL 26.7.0
Source Code Documentation
mysql::csa::Event_set_fetchable Class Referenceabstract

Represents metadata of a set of events, capable of being fetched from a storage. More...

#include <event_set_fetchable.h>

Inheritance diagram for mysql::csa::Event_set_fetchable:
[legend]

Public Types

using Fde_type = Format_description_log_event
 
using Fde_ptr = Fde_type *
 
using Log_event_ptr = std::shared_ptr< Log_event >
 

Public Member Functions

virtual bool wait_next ()=0
 Waits until the next event can be fetched. More...
 
virtual std::optional< Managed_eventfetch_next ()=0
 Fetches the next event if possible. More...
 
virtual bool is_done () const =0
 Checks if the event set has been fully fetched successfully. More...
 
virtual bool is_error () const =0
 Checks if an error occurred during fetching. More...
 
virtual const std::string & get_error_str () const =0
 Retrieves the error message if an error occurred. More...
 
virtual void reset (bool reset_events)=0
 Resets the state to allow fetching the event set again, also clearing any error state. More...
 
virtual bool is_trx () const =0
 Checks if this event set represents a complete transaction. More...
 
virtual Fde_ptr get_fde ()=0
 Obtains non-owning pointer to current transaction FDE. More...
 
virtual ~Event_set_fetchable ()=default
 Sets the end of the stream if needed. More...
 
virtual void set_success ()
 Callback on success, default - do nothing. More...
 

Detailed Description

Represents metadata of a set of events, capable of being fetched from a storage.

Typically, one event set will contain metadata of a part of, or a whole transaction. Event_set_fetchable supplies a function to fetch consecutive Log_event objects. If needed, it decompresses the underlying event stream. A transaction contains one or many fetchable event sets; this is decided by a specific implementation of a storage reader (e.g., relay log storage reader will keep separate event sets for parts of transaction kept in separate files). The specific implementation of a fetchable event set is driven by the implementation of the storage type (see Event_set_fetchable_relay_log).

Member Typedef Documentation

◆ Fde_ptr

◆ Fde_type

◆ Log_event_ptr

Constructor & Destructor Documentation

◆ ~Event_set_fetchable()

virtual mysql::csa::Event_set_fetchable::~Event_set_fetchable ( )
virtualdefault

Sets the end of the stream if needed.

Empty by default.

Virtual destructor.

Member Function Documentation

◆ fetch_next()

virtual std::optional< Managed_event > mysql::csa::Event_set_fetchable::fetch_next ( )
pure virtual

Fetches the next event if possible.

Callers are expected to wait for availability with wait_next() first when the underlying implementation supports streaming updates.

Returns
Managed_event object or an empty optional if the stream ended (with or without error).

Implemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.

◆ get_error_str()

virtual const std::string & mysql::csa::Event_set_fetchable::get_error_str ( ) const
pure virtual

Retrieves the error message if an error occurred.

Returns
A reference to the error message string (empty if no error).

Implemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.

◆ get_fde()

virtual Fde_ptr mysql::csa::Event_set_fetchable::get_fde ( )
pure virtual

Obtains non-owning pointer to current transaction FDE.

Returns
Non-owning pointer to FDE.

Implemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.

◆ is_done()

virtual bool mysql::csa::Event_set_fetchable::is_done ( ) const
pure virtual

Checks if the event set has been fully fetched successfully.

Returns
true if the event set finished successfully, false otherwise.

Implemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.

◆ is_error()

virtual bool mysql::csa::Event_set_fetchable::is_error ( ) const
pure virtual

Checks if an error occurred during fetching.

Returns
true if an error occurred, false otherwise.

Implemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.

◆ is_trx()

virtual bool mysql::csa::Event_set_fetchable::is_trx ( ) const
pure virtual

Checks if this event set represents a complete transaction.

Returns
true if it represents a transaction, false otherwise.

Implemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.

◆ reset()

virtual void mysql::csa::Event_set_fetchable::reset ( bool  reset_events)
pure virtual

Resets the state to allow fetching the event set again, also clearing any error state.

Parameters
reset_eventsWhen true events states need to be reset

Implemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.

◆ set_success()

virtual void mysql::csa::Event_set_fetchable::set_success ( )
inlinevirtual

Callback on success, default - do nothing.

Reimplemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.

◆ wait_next()

virtual bool mysql::csa::Event_set_fetchable::wait_next ( )
pure virtual

Waits until the next event can be fetched.

Returns
true if the next event can be fetched, false on end/error.

Implemented in mysql::csa::Event_set_fetchable_cache, and mysql::csa::Event_set_fetchable_relay_log.


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