24#ifndef MYSQL_CSA_STORAGE_RELAY_LOG_ISTREAM_PREFETCHED_H
25#define MYSQL_CSA_STORAGE_RELAY_LOG_ISTREAM_PREFETCHED_H
98 void copy_to(
unsigned char *
buffer, std::size_t &buffer_offset,
The abstract class for seekable input streams which have fixed length and provide seek operation.
Definition: basic_istream.h:60
Implementation of the Basic_istream, which reads data from the prefetched relay log.
Definition: istream_prefetched.h:55
Log_prefetcher_sptr m_prefetcher
Prefetcher that asynchronously fetches chunks of data from the relay log.
Definition: istream_prefetched.h:118
Batch_type m_current_batch
Batch currently in use.
Definition: istream_prefetched.h:125
virtual ~Istream_prefetched() override=default
bool m_prefetcher_error
True in case there has been prefetcher error which needs to be propagated.
Definition: istream_prefetched.h:132
Log_prefetcher::Elem_type Batch_type
Definition: istream_prefetched.h:115
void copy_to(unsigned char *buffer, std::size_t &buffer_offset, std::size_t bytes)
Helper function that copies the requested number of bytes from the current batch into buffer,...
Definition: istream_prefetched.cpp:36
bool read_next_batch()
Reads the next batch.
Definition: istream_prefetched.cpp:74
std::size_t m_file_offset
Offset from start of the file.
Definition: istream_prefetched.h:134
std::string m_allowed_file_name
Prefetcher works asynchronously on the whole relay log.
Definition: istream_prefetched.h:123
std::size_t m_current_offset
Current batch offset.
Definition: istream_prefetched.h:127
bool seek(my_off_t offset) override
If possible, seeks to a given file offset.
Definition: istream_prefetched.cpp:92
std::atomic< bool > m_is_stopped
Variable used to stop waiting for data (read may block)
Definition: istream_prefetched.h:129
ssize_t skip(std::size_t length)
Skips requested number of bytes.
Definition: istream_prefetched.cpp:32
ssize_t read(unsigned char *buffer, std::size_t length) override
Read requested number of bytes from the input stream.
Definition: istream_prefetched.cpp:46
Istream_prefetched(Log_prefetcher_sptr prefetcher, const std::string &file_name)
Construct from prefetcher.
Definition: istream_prefetched.cpp:28
my_off_t length() override
Returns currently opened file length...
Definition: istream_prefetched.cpp:101
Data_source_sptr Elem_type
Definition: log_prefetcher.h:89
Binary log event definitions.
ulonglong my_off_t
Definition: my_inttypes.h:72
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:45
Definition: channel.cpp:28
std::shared_ptr< Log_prefetcher > Log_prefetcher_sptr
Definition: log_prefetcher.h:48
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418