![]() |
MySQL 26.7.0
Source Code Documentation
|
Represents a cached chunk of data that comes from the specific relay log file (events / headers may cross boundaries of Data_source, but one Data_source does not spread across multiple relay log files) Keeps track of the number of bytes currently in use. More...
#include <data_source.h>
Public Types | |
| using | Memory_allocator = mysql::allocators::Allocator< uint8_t > |
| using | Data_type = std::vector< uint8_t, Memory_allocator > |
Public Member Functions | |
| Data_source (Data_type &&data, const std::string &file_name, std::size_t file_offset, std::size_t file_length, bool ends_file) | |
| Construct from a vector of bytes and metadata of the relay log file this data was fetched from. More... | |
| const Data_type & | data () const |
| Accesses fetched data. More... | |
| uint8_t * | data_raw () |
| Accesses raw data (reading) More... | |
| std::size_t | size () const |
| Obtains data size. More... | |
| const std::string & | get_file_name () const |
| Get source file name. More... | |
| std::size_t | get_file_length () const |
| Get source file length. More... | |
| std::size_t | get_file_offset () const |
| Return current batch file offset. More... | |
| bool | ends_file () const |
| Checks if this data chunk ends the file. More... | |
| virtual | ~Data_source () |
| Destructs object. More... | |
Private Attributes | |
| Data_type | m_data |
| Cached chunk of data. More... | |
| std::string | m_file_name {""} |
| Source relay log name. More... | |
| std::size_t | m_file_offset {0} |
| Source relay log offset. More... | |
| std::size_t | m_file_length {0} |
| Source file length. More... | |
| bool | m_is_eof {false} |
| True if EOF appears after this data chunk. More... | |
Static Private Attributes | |
| static std::atomic< std::size_t > | m_used_bytes = 0 |
| Variable to track the number of cached bytes used. More... | |
Represents a cached chunk of data that comes from the specific relay log file (events / headers may cross boundaries of Data_source, but one Data_source does not spread across multiple relay log files) Keeps track of the number of bytes currently in use.
| using mysql::csa::Data_source::Data_type = std::vector<uint8_t, Memory_allocator> |
| using mysql::csa::Data_source::Memory_allocator = mysql::allocators::Allocator<uint8_t> |
| mysql::csa::Data_source::Data_source | ( | Data_source::Data_type && | data, |
| const std::string & | file_name, | ||
| std::size_t | file_offset, | ||
| std::size_t | file_length, | ||
| bool | ends_file | ||
| ) |
Construct from a vector of bytes and metadata of the relay log file this data was fetched from.
| data | Data_source gets ownership of this data |
| file_name | The relay log file path and name (full path) |
| file_offset | The relay log file offset starting from which data was fetched |
| file_length | The number of bytes in the file_name file |
| ends_file | True if this data batch ends the file |
|
virtual |
Destructs object.
| const Data_source::Data_type & mysql::csa::Data_source::data | ( | ) | const |
Accesses fetched data.
| uint8_t * mysql::csa::Data_source::data_raw | ( | ) |
Accesses raw data (reading)
| bool mysql::csa::Data_source::ends_file | ( | ) | const |
Checks if this data chunk ends the file.
| std::size_t mysql::csa::Data_source::get_file_length | ( | ) | const |
Get source file length.
| const std::string & mysql::csa::Data_source::get_file_name | ( | ) | const |
Get source file name.
| std::size_t mysql::csa::Data_source::get_file_offset | ( | ) | const |
Return current batch file offset.
| std::size_t mysql::csa::Data_source::size | ( | ) | const |
Obtains data size.
|
private |
Cached chunk of data.
|
private |
Source file length.
|
private |
Source relay log name.
|
private |
Source relay log offset.
|
private |
True if EOF appears after this data chunk.
|
staticprivate |
Variable to track the number of cached bytes used.