![]() |
MySQL 26.7.0
Source Code Documentation
|
Empty implementation of Event_set_fetchable that does not fetch events from the storage as they were already fetched. More...
#include <event_set_fetchable_cache.h>
Public Types | |
| using | Log_event_ptr = std::shared_ptr< Log_event > |
| Shared pointer to a Log_event. More... | |
| using | Return_status = mysql::utils::Return_status |
| Type alias for return status. More... | |
| using | Event_set_type = std::vector< IReader_event_ptr > |
| Vector of Log_event_ptr representing a set of events. More... | |
| using | Stream_type = ::binlog::Decompressing_event_object_istream |
| Type alias for the decompressing event stream. More... | |
| using | Stream_ptr = std::unique_ptr< Stream_type > |
| Unique pointer to the decompressing stream. More... | |
Public Types inherited from mysql::csa::Event_set_fetchable | |
| using | Fde_type = Format_description_log_event |
| using | Fde_ptr = Fde_type * |
| using | Log_event_ptr = std::shared_ptr< Log_event > |
Public Member Functions | |
| Event_set_fetchable_cache (Event_set_type &&events, bool is_trx, Log_event_ptr fde, Relay_log_deleter_handle delete_file_handle, bool streaming_open=false) | |
| Constructs an Event_set_fetchable_cache with pre-fetched events. More... | |
| bool | wait_next () override |
| Fetches the next event from the internal cache. More... | |
| std::optional< Managed_event > | fetch_next () override |
| Fetches the next event if possible. More... | |
| const std::string & | get_error_str () const override |
| Retrieves the error message if any error occurred. More... | |
| bool | is_done () const override |
| Checks if the fetchable stream has finished processing without error. More... | |
| bool | is_error () const override |
| Checks if an error occurred in the fetchable stream. More... | |
| bool | is_trx () const override |
| Checks if this event set represents a transaction. More... | |
| void | reset (bool reset_events) override |
| Resets the state to allow fetching the event set again, clearing any error state. More... | |
| virtual | ~Event_set_fetchable_cache () override |
| Destructor. More... | |
| Fde_ptr | get_fde () override |
| Obtains non-owning pointer to current transaction FDE. More... | |
| void | set_success () override |
| Callback notifying that task was executed successfully. More... | |
| void | append_event (IReader_event_ptr event, bool seal_after=false) |
| Appends one event to a stream-open cache batch. More... | |
| void | seal_stream () |
| Seals stream-open cache batch. More... | |
| void | set_stream_truncated () |
| Marks stream-open cache batch as truncated. More... | |
Public Member Functions inherited from mysql::csa::Event_set_fetchable | |
| virtual | ~Event_set_fetchable ()=default |
| Sets the end of the stream if needed. More... | |
Private Member Functions | |
| std::optional< Log_event_ptr > | decompress () |
| Decompresses and returns the next event from the TPLE stream. More... | |
| void | end_decompression () |
| Helper to deinitialize the decompression stream and update status. More... | |
| void | start_decompression () |
| Helper to initialize the decompression stream and update status. More... | |
Private Attributes | |
| Event_set_type | m_events |
| Cached vector of events. More... | |
| bool | m_is_done = false |
| Flag indicating if processing is done (finished or error). More... | |
| std::size_t | m_event_id {0} |
| Index of the next event to fetch. More... | |
| std::string | m_failure_msg {""} |
| Detailed error message if any. More... | |
| Return_status | m_status |
| Status of the object. More... | |
| bool | m_is_trx {false} |
| Flag indicating if this is a transaction. More... | |
| bool | m_decompressing {false} |
| Flag indicating if currently decompressing a TPLE. More... | |
| Stream_ptr | m_decompressing_stream {} |
| Decompressing stream created from TPLE if any. More... | |
| Transaction_payload_log_event * | m_compressed_event_ptr {nullptr} |
| Non-owning pointer to compressed event casted to Transaction_payload_log_event. More... | |
| Log_event_ptr | m_compressed_event {} |
| Compressed event used during decompression. More... | |
| Log_event_ptr | m_fde_base {} |
| Owning pointer to Format_description_event. More... | |
| Fde_ptr | m_fde {} |
| Non-owning pointer to Format_description_event. More... | |
| Relay_log_deleter_handle | m_delete_file_handle |
| Handle to relay log deleter, relay log will be removed when last living reference to this file is released. More... | |
| std::mutex | m_stream_mutex |
| Stream synchronization state. More... | |
| std::condition_variable | m_stream_cv |
| bool | m_stream_open {false} |
| bool | m_stream_sealed {true} |
| bool | m_stream_truncated {false} |
Empty implementation of Event_set_fetchable that does not fetch events from the storage as they were already fetched.
It returns cached event objects instead.
| using mysql::csa::Event_set_fetchable_cache::Event_set_type = std::vector<IReader_event_ptr> |
Vector of Log_event_ptr representing a set of events.
| using mysql::csa::Event_set_fetchable_cache::Log_event_ptr = std::shared_ptr<Log_event> |
Shared pointer to a Log_event.
Type alias for return status.
| using mysql::csa::Event_set_fetchable_cache::Stream_ptr = std::unique_ptr<Stream_type> |
Unique pointer to the decompressing stream.
| using mysql::csa::Event_set_fetchable_cache::Stream_type = ::binlog::Decompressing_event_object_istream |
Type alias for the decompressing event stream.
| mysql::csa::Event_set_fetchable_cache::Event_set_fetchable_cache | ( | Event_set_fetchable_cache::Event_set_type && | events, |
| bool | is_trx, | ||
| Event_set_fetchable::Log_event_ptr | fde, | ||
| Relay_log_deleter_handle | delete_file_handle, | ||
| bool | streaming_open = false |
||
| ) |
Constructs an Event_set_fetchable_cache with pre-fetched events.
| events | The vector of events to cache (moved into the object). |
| is_trx | Flag indicating if this set represents a transaction. |
| fde | Shared pointer to the Format_description_event. |
| delete_file_handle | Handle to the relay log deleter. |
| streaming_open | If true, events may be appended concurrently. |
|
overridevirtual |
Destructor.
| void mysql::csa::Event_set_fetchable_cache::append_event | ( | IReader_event_ptr | event, |
| bool | seal_after = false |
||
| ) |
Appends one event to a stream-open cache batch.
| event | Event to append |
| seal_after | When true, the batch is sealed together with publish. |
|
private |
Decompresses and returns the next event from the TPLE stream.
|
private |
Helper to deinitialize the decompression stream and update status.
|
overridevirtual |
Fetches the next event if possible.
Callers are expected to wait for availability with wait_next() first when the underlying implementation supports streaming updates.
Implements mysql::csa::Event_set_fetchable.
|
overridevirtual |
Retrieves the error message if any error occurred.
Implements mysql::csa::Event_set_fetchable.
|
overridevirtual |
Obtains non-owning pointer to current transaction FDE.
Implements mysql::csa::Event_set_fetchable.
|
overridevirtual |
Checks if the fetchable stream has finished processing without error.
Implements mysql::csa::Event_set_fetchable.
|
overridevirtual |
Checks if an error occurred in the fetchable stream.
Implements mysql::csa::Event_set_fetchable.
|
overridevirtual |
Checks if this event set represents a transaction.
Implements mysql::csa::Event_set_fetchable.
|
overridevirtual |
Resets the state to allow fetching the event set again, clearing any error state.
| reset_events | When true events states need to be reset |
Implements mysql::csa::Event_set_fetchable.
| void mysql::csa::Event_set_fetchable_cache::seal_stream | ( | ) |
Seals stream-open cache batch.
| void mysql::csa::Event_set_fetchable_cache::set_stream_truncated | ( | ) |
Marks stream-open cache batch as truncated.
|
overridevirtual |
Callback notifying that task was executed successfully.
Reimplemented from mysql::csa::Event_set_fetchable.
|
private |
Helper to initialize the decompression stream and update status.
|
overridevirtual |
Fetches the next event from the internal cache.
Implements mysql::csa::Event_set_fetchable.
|
private |
Compressed event used during decompression.
|
private |
Non-owning pointer to compressed event casted to Transaction_payload_log_event.
|
private |
Flag indicating if currently decompressing a TPLE.
|
private |
Decompressing stream created from TPLE if any.
|
private |
Handle to relay log deleter, relay log will be removed when last living reference to this file is released.
|
private |
Index of the next event to fetch.
|
private |
Cached vector of events.
|
private |
Detailed error message if any.
|
private |
Non-owning pointer to Format_description_event.
|
private |
Owning pointer to Format_description_event.
|
private |
Flag indicating if processing is done (finished or error).
|
private |
Flag indicating if this is a transaction.
|
private |
Status of the object.
|
private |
|
mutableprivate |
Stream synchronization state.
|
private |
|
private |
|
private |