MySQL 26.7.0
Source Code Documentation
mysql::csa::Prefetched_ifile Class Reference

Implementation of the Basic_binlog_ifile, which works on the prefetched stream (Istream_prefetched) Exposes additional function to set prefetcher (since legacy design does not allow to use a custom constructor - see Basic_binlog_file_reader). More...

#include <prefetched_ifile.h>

Inheritance diagram for mysql::csa::Prefetched_ifile:
[legend]

Public Member Functions

void set_prefetcher (Log_prefetcher_sptr prefetcher)
 Sets the prefetcher. More...
 
 Basic_binlog_ifile (Binlog_read_error *binlog_read_error)
 
 Basic_binlog_ifile (const Basic_binlog_ifile &)=delete
 
- Public Member Functions inherited from Basic_binlog_ifile
 Basic_binlog_ifile (Binlog_read_error *binlog_read_error)
 
 Basic_binlog_ifile (const Basic_binlog_ifile &)=delete
 
Basic_binlog_ifileoperator= (const Basic_binlog_ifile &)=delete
 
virtual ~Basic_binlog_ifile () override
 
bool open (const char *file_name)
 Open a binlog file. More...
 
void close ()
 Close the binlog file it is reading. More...
 
ssize_t read (unsigned char *buffer, size_t length) override
 Read some bytes from the input stream. More...
 
bool seek (my_off_t position) override
 Puts the read position to a given offset. More...
 
my_off_t position () const
 
bool is_open () const
 
const std::string & file_name () const
 
my_off_t length () override
 Get length of the binlog file. More...
 
- Public Member Functions inherited from Basic_seekable_istream
virtual ~Basic_seekable_istream () override=default
 
- Public Member Functions inherited from Basic_istream
virtual ~Basic_istream ()=default
 

Protected Member Functions

std::unique_ptr< Basic_seekable_istreamopen_file (const char *file_name) override
 Creates stream object "from the file". More...
 

Protected Attributes

std::string m_current_file
 File currently opened. More...
 
Log_prefetcher_sptr m_prefetcher
 Prefetcher object we need to pass into created stream. More...
 
- Protected Attributes inherited from Basic_binlog_ifile
Binlog_read_errorm_error
 It is convenient for caller to share a Binlog_read_error object between streams. More...
 

Detailed Description

Implementation of the Basic_binlog_ifile, which works on the prefetched stream (Istream_prefetched) Exposes additional function to set prefetcher (since legacy design does not allow to use a custom constructor - see Basic_binlog_file_reader).

Member Function Documentation

◆ Basic_binlog_ifile() [1/2]

Basic_binlog_ifile::Basic_binlog_ifile ( Binlog_read_error binlog_read_error)
Parameters
[in]binlog_read_errorBasic_binlog_ifile doesn't own an Binlog_read_error. So the caller should provide one to it. When error happens, the error type will be set into 'error'.

◆ Basic_binlog_ifile() [2/2]

Basic_binlog_ifile::Basic_binlog_ifile ( const Basic_binlog_ifile )
delete

◆ open_file()

std::unique_ptr< Basic_seekable_istream > mysql::csa::Prefetched_ifile::open_file ( const char *  file_name)
overrideprotectedvirtual

Creates stream object "from the file".

Data will be obtained via prefetcher

Implements Basic_binlog_ifile.

◆ set_prefetcher()

void mysql::csa::Prefetched_ifile::set_prefetcher ( Log_prefetcher_sptr  prefetcher)

Sets the prefetcher.

Prefetcher must be set before opening the first file. Later on, same prefetcher object is reused to initialize Istream_prefetched object, which uses asynchronous prefetcher to get data.

Parameters
prefetcherShared prefetcher object.

Member Data Documentation

◆ m_current_file

std::string mysql::csa::Prefetched_ifile::m_current_file
protected

File currently opened.

◆ m_prefetcher

Log_prefetcher_sptr mysql::csa::Prefetched_ifile::m_prefetcher
protected

Prefetcher object we need to pass into created stream.


The documentation for this class was generated from the following files: