![]() |
MySQL 26.7.0
Source Code Documentation
|
Implementation of 'Transaction_provider' interface. More...
#include <sync_transaction_provider.h>
Public Member Functions | |
| Sync_transaction_provider (int instance_id, Relay_log_info *rli, std::size_t max_read_event_bytes, std::size_t max_read_payload_bytes) | |
| void | start () override |
| Starts asynchronous thread that decodes jobs from the stream. More... | |
| void | stop () override |
| Stops provider and wakes blocked reader calls. More... | |
| void | finish () override |
| Completes provider shutdown from the owner thread (transaction receiver). More... | |
| Job_ptr | next () override |
| Consumes the next Job, blocks until fetched. More... | |
| bool | is_stopped () const override |
| Checks if stop has been requested. More... | |
| bool | is_error () const override |
| Check if provider has an error. More... | |
Public Member Functions inherited from mysql::csa::Transaction_provider | |
| virtual | ~Transaction_provider ()=default |
| Destructor. More... | |
Private Attributes | |
| std::atomic< bool > | m_is_stopped {false} |
| Variable to gracefully stop the thread. More... | |
| Relay_log_info * | m_rli |
| Pointer to channel rli object. More... | |
| Reader_sptr | m_reader |
| Shared reader object. More... | |
| scheduler::Statistics_instance_monitor_ref | m_stat_monitor |
| Statistics monitoring object. More... | |
Additional Inherited Members | |
Public Types inherited from mysql::csa::Transaction_provider | |
| using | Common_reader_type = Relay_log_adaptive_reader |
Implementation of 'Transaction_provider' interface.
This implementation uses the relay log reader to read consecutive events from the relay log. Data is read from prefetched stream. Main methods are:
| mysql::csa::Sync_transaction_provider::Sync_transaction_provider | ( | int | instance_id, |
| Relay_log_info * | rli, | ||
| std::size_t | max_read_event_bytes, | ||
| std::size_t | max_read_payload_bytes | ||
| ) |
| instance_id | Instance (channel) id |
| rli | Pointer to relay log info structure |
| max_read_event_bytes | The maximum number of bytes in a transaction which reader can read, decode and cache |
| max_read_payload_bytes | The maximum number of bytes in a transaction which reader can read and cache payload |
|
overridevirtual |
Completes provider shutdown from the owner thread (transaction receiver).
Requires stop to have been called first; otherwise it is a no-op.
Implements mysql::csa::Transaction_provider.
|
overridevirtual |
Check if provider has an error.
Implements mysql::csa::Transaction_provider.
|
overridevirtual |
Checks if stop has been requested.
Implements mysql::csa::Transaction_provider.
|
overridevirtual |
Consumes the next Job, blocks until fetched.
| Job | smart pointer |
| Empty | pointer in case stop has been requested (check with 'is_stopped') or we timed out waiting for event. In case we timed out, we return an empty pointer to wake up parent thread for a while, so that it can do some maintenance activities, such as checking status or checking statistics |
Implements mysql::csa::Transaction_provider.
|
overridevirtual |
Starts asynchronous thread that decodes jobs from the stream.
Implements mysql::csa::Transaction_provider.
|
overridevirtual |
Stops provider and wakes blocked reader calls.
Implements mysql::csa::Transaction_provider.
|
private |
Variable to gracefully stop the thread.
|
private |
Shared reader object.
|
private |
Pointer to channel rli object.
|
private |
Statistics monitoring object.