MySQL 9.1.0
Source Code Documentation
|
Meta information about single log file. More...
#include <log0types.h>
Public Member Functions | |
Log_file (const Log_file &other)=default | |
bool | operator== (const Log_file &rhs) const |
Checks if this object is equal to a given another object. More... | |
void | lsn_validate () const |
Validates that lsn fields seem correct (m_start_lsn, m_end_lsn) More... | |
bool | contains (lsn_t lsn) const |
Checks if a given lsn belongs to [m_start_lsn, m_end_lsn). More... | |
os_offset_t | offset (lsn_t lsn) const |
Provides offset for the given LSN (from the beginning of the log file). More... | |
Log_file_id | next_id () const |
Computes id of the next log file. More... | |
Static Public Member Functions | |
static os_offset_t | offset (lsn_t lsn, lsn_t file_start_lsn) |
Provides offset for the given LSN and log file with the given start_lsn (offset from the beginning of the log file). More... | |
static Log_file_id | next_id (Log_file_id id, size_t inc=1) |
Computes id + inc, asserting it does not overflow the maximum value. More... | |
Public Attributes | |
const Log_files_context & | m_files_ctx |
Context within which this file exists. More... | |
Log_file_id | m_id |
ID of the file. More... | |
bool | m_consumed |
Set to true when file becomes consumed. More... | |
bool | m_full |
Set to true when file became full and next file exists. More... | |
os_offset_t | m_size_in_bytes |
Size, expressed in bytes, including LOG_FILE_HDR_SIZE. More... | |
lsn_t | m_start_lsn |
LSN of the first byte within the file, aligned to OS_FILE_LOG_BLOCK_SIZE. More... | |
lsn_t | m_end_lsn |
LSN of the first byte after the file, aligned to OS_FILE_LOG_BLOCK_SIZE. More... | |
Encryption_metadata & | m_encryption_metadata |
Encryption metadata passed to opened file handles. More... | |
Log_file_handle implementation | |
Log_file (const Log_files_context &files_ctx, Encryption_metadata &encryption_metadata) | |
Log_file (const Log_files_context &files_ctx, Log_file_id id, bool consumed, bool full, os_offset_t size_in_bytes, lsn_t start_lsn, lsn_t end_lsn, Encryption_metadata &encryption_metadata) | |
Log_file & | operator= (const Log_file &other) |
Log_file_handle | open (Log_file_access_mode access_mode) const |
Opens this file and provides handle that allows to read from this file and / or write to this file (depends on the requested access mode). More... | |
static Log_file_handle | open (const Log_files_context &files_ctx, Log_file_id file_id, Log_file_access_mode access_mode, Encryption_metadata &encryption_metadata, Log_file_type file_type=Log_file_type::NORMAL) |
Opens a given redo log file and provides handle that allows to read from that file and / or write to that file (depends on the requested access mode). More... | |
Meta information about single log file.
Log_file::Log_file | ( | const Log_files_context & | files_ctx, |
Encryption_metadata & | encryption_metadata | ||
) |
Log_file::Log_file | ( | const Log_files_context & | files_ctx, |
Log_file_id | id, | ||
bool | consumed, | ||
bool | full, | ||
os_offset_t | size_in_bytes, | ||
lsn_t | start_lsn, | ||
lsn_t | end_lsn, | ||
Encryption_metadata & | encryption_metadata | ||
) |
|
default |
|
inline |
Checks if a given lsn belongs to [m_start_lsn, m_end_lsn).
In other words, checks that the given lsn belongs to this file.
[in] | lsn | lsn to test against lsn range |
|
inline |
Validates that lsn fields seem correct (m_start_lsn, m_end_lsn)
|
inline |
Computes id of the next log file.
Does not check if such file exists.
|
inlinestatic |
Computes id + inc, asserting it does not overflow the maximum value.
[in] | id | base id of file, to which inc is added |
[in] | inc | number of log files ahead (1 = directly next one) |
|
inline |
Provides offset for the given LSN (from the beginning of the log file).
[in] | lsn | lsn to locate (must exist in the file) |
|
inlinestatic |
Provides offset for the given LSN and log file with the given start_lsn (offset from the beginning of the log file).
[in] | lsn | lsn to locate (must be >= file_start_lsn) |
[in] | file_start_lsn | start lsn of the log file |
|
static |
Opens a given redo log file and provides handle that allows to read from that file and / or write to that file (depends on the requested access mode).
[in] | files_ctx | context within which file exists |
[in] | file_id | id of the redo log file to open |
[in] | access_mode | requested access mode (reads and/or writes) |
[in] | encryption_metadata | encryption metadata |
[in] | file_type | type of underlying file on disk to open |
Log_file_handle Log_file::open | ( | Log_file_access_mode | access_mode | ) | const |
Opens this file and provides handle that allows to read from this file and / or write to this file (depends on the requested access mode).
[in] | access_mode | requested access mode (reads and/or writes) |
|
inline |
Checks if this object is equal to a given another object.
[in] | rhs | the object to compare against |
bool Log_file::m_consumed |
Set to true when file becomes consumed.
Encryption_metadata& Log_file::m_encryption_metadata |
Encryption metadata passed to opened file handles.
lsn_t Log_file::m_end_lsn |
LSN of the first byte after the file, aligned to OS_FILE_LOG_BLOCK_SIZE.
const Log_files_context& Log_file::m_files_ctx |
Context within which this file exists.
bool Log_file::m_full |
Set to true when file became full and next file exists.
Log_file_id Log_file::m_id |
ID of the file.
os_offset_t Log_file::m_size_in_bytes |
Size, expressed in bytes, including LOG_FILE_HDR_SIZE.
lsn_t Log_file::m_start_lsn |
LSN of the first byte within the file, aligned to OS_FILE_LOG_BLOCK_SIZE.