![]() |
MySQL 26.7.0
Source Code Documentation
|
Iterates over relay log and returns fetchable Jobs This reader reads consecutive events from the relay log and caches events. More...
#include <relay_log_adaptive_reader.h>
Public Member Functions | |
| Relay_log_adaptive_reader (int instance_id, Relay_log_info *rli, std::size_t max_read_event_bytes, std::size_t max_read_payload_bytes) | |
| virtual | ~Relay_log_adaptive_reader () override |
| Relay_log_adaptive_reader (const Relay_log_adaptive_reader &)=delete | |
| Relay_log_adaptive_reader & | operator= (const Relay_log_adaptive_reader &)=delete |
| Relay_log_adaptive_reader (Relay_log_adaptive_reader &&)=delete | |
| Relay_log_adaptive_reader & | operator= (Relay_log_adaptive_reader &&)=delete |
| Job_ptr | read () override |
| Reads the next Job (full transaction) from the relay log and supplies a fetchable job object. More... | |
| bool | is_stopped () const override |
| Checks whether CSA is stopped. More... | |
| bool | is_error () const override |
| Checks whether reader errored out True - reader errored out. More... | |
| void | stop () override |
| Awakes and stops the reader. More... | |
Public Member Functions inherited from mysql::csa::Reader | |
| virtual | ~Reader ()=default |
| Destructor. More... | |
Private Types | |
| using | Transaction_boundary_parser = mysql::binlog::event::Transaction_boundary_parser |
Private Member Functions | |
| void | tune () |
| Tunes reader parameters based on CSA statistics. More... | |
Private Attributes | |
| Relay_log_info * | m_rli {nullptr} |
| Pointer to the relay log context of applier thread that launches CSA. More... | |
| Event_reader_controller * | m_reader {nullptr} |
| Applier reader, object used to read event METADATA (non owning pointer) More... | |
| Log_purge_controller_sptr | m_shared_controller |
| Owning pointer of applier reader. More... | |
| Relay_log_deleter_handle | m_delete_handler {nullptr} |
| Deleter for the current file. More... | |
| Log_prefetcher_sptr | m_prefetcher |
| std::shared_ptr< Log_event > | m_current_fde |
| Current FDE pointer. Source's FDEs are attached to transactions. More... | |
| Transaction_boundary_parser | m_transaction_boundary_parser |
| std::shared_ptr< Fetchable_transaction > | m_active_fetchable_transaction |
| Event_file_metadata | m_start_batch_metadata |
| Reader_controller_read_type | m_read_type {Reader_controller_read_type::event} |
| Reader_controller_read_type | m_next_read_type |
| Event_set_fetchable_cache * | m_open_cache_batch {nullptr} |
| Event_set_fetchable_relay_log * | m_open_stream_batch {nullptr} |
| std::size_t | m_current_transaction_max_event_length {0} |
| bool | m_is_in_trx {false} |
| int64_t | m_prev_seq {-1} |
| Previous sequence number recorded to validate timestamps. More... | |
| bool | m_is_error {false} |
| Internal error flag. More... | |
| bool | m_stopped {false} |
| Stop flag, set externally or by reached until condition. More... | |
| unsigned int | m_instance_id {0} |
| Unique instance id for statistics monitoring. More... | |
| scheduler::Statistics_instance_monitor_ref | m_stat_monitor |
| Statistics monitoring object for the current instance. More... | |
| Resource_instance_monitor_ref | m_resource_monitor |
| Resource monitoring object for the current instance. More... | |
| std::size_t | m_max_read_event_bytes {tune::provider_max_read_event_bytes} |
| The maximum number of bytes that this reader can cache for a single transaction with decoding. More... | |
| std::size_t | m_max_read_payload_bytes {tune::provider_max_read_payload_bytes} |
| The maximum number of bytes that this reader can cache for a single transaction without decoding. More... | |
| std::unique_ptr< Channel > | m_channel |
| Owning pointer to channel object. More... | |
| double | m_worker_min_load_threshold {0.3} |
| Threshold below which we ask workers to read transactions in order to increase reader and receiver throughput. More... | |
| double | m_worker_max_load_threshold {0.8} |
| Threshold above which we go back to previous settings. More... | |
| Sliding_window_counter | m_thp_task_exec_time {0} |
| Used to calculate workers load. More... | |
| Sliding_window_counter | m_thp_worker_exec_time {0} |
| Used to calculate workers load. More... | |
| std::chrono::time_point< std::chrono::system_clock > | m_last_tune_time |
| Time point at which we tuned parameters for the last time. More... | |
| long int | m_tune_period_ms {5000} |
| We tune parameters each m_tune_period_ms milliseconds. More... | |
Iterates over relay log and returns fetchable Jobs This reader reads consecutive events from the relay log and caches events.
When 'max_read_event_bytes' is reached for a single transaction, the reader switches to "metadata" mode. From this point, it will read only event metadata from the relay log and supply event set batches that are able to fetch themselves from the relay log on demand (durring apply)
|
private |
| mysql::csa::Relay_log_adaptive_reader::Relay_log_adaptive_reader | ( | 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 | RLI for the channel |
| 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 |
|
delete |
|
delete |
|
overridevirtual |
Checks whether reader errored out True - reader errored out.
False - no error.
Implements mysql::csa::Reader.
|
overridevirtual |
Checks whether CSA is stopped.
True if stop was requested, false otherwise
Implements mysql::csa::Reader.
|
delete |
|
delete |
|
overridevirtual |
Reads the next Job (full transaction) from the relay log and supplies a fetchable job object.
This function may block for a while in case it is reading from an active relay log and when being outside of transaction boundary.
Implements mysql::csa::Reader.
|
overridevirtual |
Awakes and stops the reader.
Implements mysql::csa::Reader.
|
private |
Tunes reader parameters based on CSA statistics.
|
private |
|
private |
Owning pointer to channel object.
|
private |
Current FDE pointer. Source's FDEs are attached to transactions.
|
private |
|
private |
Deleter for the current file.
|
private |
Unique instance id for statistics monitoring.
|
private |
Internal error flag.
|
private |
|
private |
Time point at which we tuned parameters for the last time.
|
private |
The maximum number of bytes that this reader can cache for a single transaction with decoding.
When this limit is reached, reader switches to payload cache read mode.
|
private |
The maximum number of bytes that this reader can cache for a single transaction without decoding.
When this limit is reached, reader switches to reading of transaction metadata
|
private |
|
private |
|
private |
|
private |
|
private |
Previous sequence number recorded to validate timestamps.
|
private |
|
private |
Applier reader, object used to read event METADATA (non owning pointer)
|
private |
Resource monitoring object for the current instance.
|
private |
Pointer to the relay log context of applier thread that launches CSA.
It contains pointer to the actual relay log object needed for reading transactions
|
private |
Owning pointer of applier reader.
|
private |
|
private |
Statistics monitoring object for the current instance.
|
private |
Stop flag, set externally or by reached until condition.
|
private |
Used to calculate workers load.
|
private |
Used to calculate workers load.
|
private |
|
private |
We tune parameters each m_tune_period_ms milliseconds.
|
private |
Threshold above which we go back to previous settings.
|
private |
Threshold below which we ask workers to read transactions in order to increase reader and receiver throughput.