MySQL 9.1.0
Source Code Documentation
|
In-memory dictionary of log files (keeps their meta data). More...
#include <algorithm>
#include <iterator>
#include "log0types.h"
#include "os0file.h"
#include "ut0ut.h"
Go to the source code of this file.
Classes | |
class | Log_files_dict |
In-memory dictionary of meta data of existing log files. More... | |
class | Log_files_dict::Const_iterator |
Functions | |
template<typename F > | |
void | log_files_for_each (const Log_files_dict &files, F functor) |
template<typename F > | |
void | log_files_for_each (const Log_files_dict &files, lsn_t start_lsn, lsn_t end_lsn, F functor) |
Calls the given functor for each of existing log files on path from a file containing start_lsn to a file containing end_lsn - 1. More... | |
bool | log_file_compute_logical_capacity (os_offset_t file_size_in_bytes, lsn_t &lsn_capacity) |
Computes logical capacity for the given physical size of the redo log file. More... | |
bool | log_file_compute_end_lsn (lsn_t start_lsn, os_offset_t file_size_in_bytes, lsn_t &end_lsn) |
Computes end_lsn for the given: start_lsn and size of the redo log file. More... | |
size_t | log_files_number_of_existing_files (const Log_files_dict &files) |
Counts the total number of existing log files. More... | |
size_t | log_files_number_of_consumed_files (const Log_files_dict &files) |
Counts the total number of existing and marked as consumed log files. More... | |
os_offset_t | log_files_size_of_existing_files (const Log_files_dict &files) |
Computes the total size of the existing log files (sum of sizes). More... | |
lsn_t | log_files_capacity_of_existing_files (const Log_files_dict &files) |
Computes the total capacity of the existing log files (sum of capacities). More... | |
Log_files_dict::Const_iterator | log_files_find_largest (const Log_files_dict &files) |
Finds the largest existing log file (with the largest m_size_in_bytes). More... | |
In-memory dictionary of log files (keeps their meta data).
The dictionary is built by the
bool log_file_compute_end_lsn | ( | lsn_t | start_lsn, |
os_offset_t | file_size_in_bytes, | ||
lsn_t & | end_lsn | ||
) |
Computes end_lsn for the given: start_lsn and size of the redo log file.
[in] | start_lsn | LSN of the first data byte within the file |
[in] | file_size_in_bytes | total size of file, expressed in bytes |
[out] | end_lsn | LSN after the last data byte within the file |
true | succeeded to compute end_lsn |
false | params were invalid |
bool log_file_compute_logical_capacity | ( | os_offset_t | file_size_in_bytes, |
lsn_t & | lsn_capacity | ||
) |
Computes logical capacity for the given physical size of the redo log file.
[in] | file_size_in_bytes | total size of file, expressed in bytes |
[out] | lsn_capacity | logical capacity of the file |
true | succeeded to compute the logical capacity |
false | params were invalid (file size was too small or too big) |
lsn_t log_files_capacity_of_existing_files | ( | const Log_files_dict & | files | ) |
Computes the total capacity of the existing log files (sum of capacities).
[in] | files | in-memory dictionary of log files |
Log_files_dict::Const_iterator log_files_find_largest | ( | const Log_files_dict & | files | ) |
Finds the largest existing log file (with the largest m_size_in_bytes).
[in] | files | in-memory dictionary of log files |
void log_files_for_each | ( | const Log_files_dict & | files, |
F | functor | ||
) |
void log_files_for_each | ( | const Log_files_dict & | files, |
lsn_t | start_lsn, | ||
lsn_t | end_lsn, | ||
F | functor | ||
) |
Calls the given functor for each of existing log files on path from a file containing start_lsn to a file containing end_lsn - 1.
Asserts that such a path exists (going through existing log files). When the range is empty (start_lsn >= end_lsn), no file is visited.
[in] | files | in-memory dictionary of log files |
[in] | start_lsn | path starts at file reported by find(start_lsn) |
[in] | end_lsn | path ends in file with m_end_lsn >= end_lsn |
[in] | functor | functor receiving a reference to Log_file |
size_t log_files_number_of_consumed_files | ( | const Log_files_dict & | files | ) |
Counts the total number of existing and marked as consumed log files.
[in] | files | in-memory dictionary of log files |
size_t log_files_number_of_existing_files | ( | const Log_files_dict & | files | ) |
Counts the total number of existing log files.
[in] | files | in-memory dictionary of log files |
os_offset_t log_files_size_of_existing_files | ( | const Log_files_dict & | files | ) |
Computes the total size of the existing log files (sum of sizes).
[in] | files | in-memory dictionary of log files |