![]() |
MySQL 26.7.0
Source Code Documentation
|
Opaque for transaction, that is able to fetch itself in parts from the storage on demand. More...
#include <fetchable_transaction.h>
Public Types | |
| using | Return_status = mysql::utils::Return_status |
Public Member Functions | |
| Fetchable_transaction () | |
| Fetch function is supplied by a specific storage implementation. More... | |
| Fetchable_transaction (Event_set_fetchable_list &&fetch_object) | |
| Fetchable_transaction (const Fetchable_transaction &)=delete | |
| Fetchable_transaction (Fetchable_transaction &&)=delete | |
| virtual | ~Fetchable_transaction () |
| Destructor. More... | |
| bool | wait_next () |
| Fetches consecutive events from the storage, until done or error occurs. More... | |
| std::optional< Managed_event > | fetch_next () |
| bool | is_fetching_error () const |
| Returs true when fetching failed. More... | |
| bool | is_fetching_done () const |
| Checks current status of the object. More... | |
| bool | is_truncated () const |
| Checks whether fetching stopped because the metadata stream was truncated. More... | |
| std::size_t | get_max_event_length () const |
| Returns the maximum event length published for this transaction. More... | |
| void | reset_fetching (bool all) |
| Reset the status of the Featchable job allowing it to be re-read from the storage. More... | |
| std::string | get_fetch_error_msg () const |
| Accesses fetch error message. More... | |
| bool | is_trx () const |
| Returns information on whether this is actual transaction (transaction starting with a GTID) More... | |
| void | set_success () |
| Marks that transaction committed succesfully, success callback. More... | |
| Format_description_log_event * | get_fde () |
| Obtains non-owning pointer to current FDE. More... | |
| void | set_fetching_done () |
| Mark that fetching is successfully done, even if transaction was not fully read. More... | |
| void | append_batch (Event_set_fetchable_ptr batch) |
| Appends a new fetchable batch for this transaction. More... | |
| void | set_fetching_complete () |
| Seals transaction metadata stream. No more batches will be appended. More... | |
| void | update_max_event_length (std::size_t event_length) |
| Updates the maximum event length published for this transaction. More... | |
| void | set_fetching_truncated () |
| Marks transaction metadata stream as truncated. More... | |
Private Member Functions | |
| Event_set_fetchable * | wait_for_current_batch () |
| Waits until a current batch becomes available or fetching reaches a terminal state. More... | |
| bool | advance_finished_batch_unsafe (Event_set_fetchable *event_batch) |
| Advances to the next batch if the current one has finished. More... | |
| std::optional< Event_set_fetchable * > | get_current_event_batch_unsafe () |
| Iterates over event sets, picking a correct batch. More... | |
Private Attributes | |
| std::string | m_error_message |
| Detailed error message if error appears. More... | |
| Return_status | m_status |
| Internal status of event. More... | |
| bool | m_is_done {false} |
| True when the consumer-side fetch stream reached a terminal state. More... | |
| bool | m_is_complete {false} |
| True when reader has finished appending batches. More... | |
| std::atomic< std::size_t > | m_max_event_length {0} |
| Maximum event length published for this transaction. More... | |
| std::atomic< bool > | m_is_truncated {false} |
| True when reader marked metadata stream as truncated. More... | |
| std::mutex | m_mutex |
| Guard for concurrent producer (reader) and consumer (worker). More... | |
| std::condition_variable | m_cv |
| Notification for appended batches / terminal state updates. More... | |
| Event_set_fetchable_list | m_event_set_batches |
| Object used to fetch transaction events from the storage. More... | |
| Event_set_fetchable_list::iterator | m_current_batch_it |
| Currently processed event batch iterator. More... | |
Opaque for transaction, that is able to fetch itself in parts from the storage on demand.
Function to fetch an event is supplied by the specific storage implementation.
| mysql::csa::Fetchable_transaction::Fetchable_transaction | ( | ) |
Fetch function is supplied by a specific storage implementation.
| mysql::csa::Fetchable_transaction::Fetchable_transaction | ( | Event_set_fetchable_list && | fetch_object | ) |
|
delete |
|
delete |
|
virtual |
Destructor.
|
private |
Advances to the next batch if the current one has finished.
| event_batch | Current batch being processed. |
| true | The whole transaction finished. |
| false | There may still be more events or batches to fetch. |
| void mysql::csa::Fetchable_transaction::append_batch | ( | Event_set_fetchable_ptr | batch | ) |
Appends a new fetchable batch for this transaction.
| std::optional< Managed_event > mysql::csa::Fetchable_transaction::fetch_next | ( | ) |
|
private |
Iterates over event sets, picking a correct batch.
| Format_description_log_event * mysql::csa::Fetchable_transaction::get_fde | ( | ) |
Obtains non-owning pointer to current FDE.
| std::string mysql::csa::Fetchable_transaction::get_fetch_error_msg | ( | ) | const |
Accesses fetch error message.
| std::size_t mysql::csa::Fetchable_transaction::get_max_event_length | ( | ) | const |
Returns the maximum event length published for this transaction.
| bool mysql::csa::Fetchable_transaction::is_fetching_done | ( | ) | const |
Checks current status of the object.
| bool mysql::csa::Fetchable_transaction::is_fetching_error | ( | ) | const |
Returs true when fetching failed.
| bool mysql::csa::Fetchable_transaction::is_truncated | ( | ) | const |
Checks whether fetching stopped because the metadata stream was truncated.
| bool mysql::csa::Fetchable_transaction::is_trx | ( | ) | const |
Returns information on whether this is actual transaction (transaction starting with a GTID)
| void mysql::csa::Fetchable_transaction::reset_fetching | ( | bool | all | ) |
Reset the status of the Featchable job allowing it to be re-read from the storage.
| all | When true, internal object states must be reset |
| void mysql::csa::Fetchable_transaction::set_fetching_complete | ( | ) |
Seals transaction metadata stream. No more batches will be appended.
| void mysql::csa::Fetchable_transaction::set_fetching_done | ( | ) |
Mark that fetching is successfully done, even if transaction was not fully read.
| void mysql::csa::Fetchable_transaction::set_fetching_truncated | ( | ) |
Marks transaction metadata stream as truncated.
| void mysql::csa::Fetchable_transaction::set_success | ( | ) |
Marks that transaction committed succesfully, success callback.
| void mysql::csa::Fetchable_transaction::update_max_event_length | ( | std::size_t | event_length | ) |
Updates the maximum event length published for this transaction.
|
private |
Waits until a current batch becomes available or fetching reaches a terminal state.
| bool mysql::csa::Fetchable_transaction::wait_next | ( | ) |
Fetches consecutive events from the storage, until done or error occurs.
|
private |
Currently processed event batch iterator.
|
private |
Notification for appended batches / terminal state updates.
|
private |
Detailed error message if error appears.
|
private |
Object used to fetch transaction events from the storage.
|
private |
True when reader has finished appending batches.
|
private |
True when the consumer-side fetch stream reached a terminal state.
|
private |
True when reader marked metadata stream as truncated.
|
private |
Maximum event length published for this transaction.
|
mutableprivate |
Guard for concurrent producer (reader) and consumer (worker).
|
private |
Internal status of event.