MySQL 9.1.0
Source Code Documentation
log0files_dict.cc File Reference

Redo log - in-memory dictionary of log files (their meta data). More...

#include <algorithm>
#include <iterator>
#include <numeric>
#include "log0files_dict.h"

Functions

Helpers
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...
 

Detailed Description

Redo log - in-memory dictionary of log files (their meta data).

Function Documentation

◆ log_file_compute_end_lsn()

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.

Parameters
[in]start_lsnLSN of the first data byte within the file
[in]file_size_in_bytestotal size of file, expressed in bytes
[out]end_lsnLSN after the last data byte within the file
Return values
truesucceeded to compute end_lsn
falseparams were invalid

◆ log_file_compute_logical_capacity()

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.

Parameters
[in]file_size_in_bytestotal size of file, expressed in bytes
[out]lsn_capacitylogical capacity of the file
Return values
truesucceeded to compute the logical capacity
falseparams were invalid (file size was too small or too big)

◆ log_files_capacity_of_existing_files()

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).

Note
Capacity of a file is smaller than size of the file by LOG_FILE_HDR_SIZE.
Parameters
[in]filesin-memory dictionary of log files
Returns
computed total capacity of existing log files

◆ log_files_find_largest()

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).

Parameters
[in]filesin-memory dictionary of log files
Returns
the largest file or files.end() if there is no file at all

◆ log_files_number_of_consumed_files()

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.

Parameters
[in]filesin-memory dictionary of log files
Returns
number of existing and marked as consumed log files.

◆ log_files_number_of_existing_files()

size_t log_files_number_of_existing_files ( const Log_files_dict files)

Counts the total number of existing log files.

Parameters
[in]filesin-memory dictionary of log files
Returns
number of existing log files.

◆ log_files_size_of_existing_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).

Note
Each file starts with LOG_FILE_HDR_SIZE bytes of headers.
Parameters
[in]filesin-memory dictionary of log files
Returns
computed total size of existing log files