MySQL 8.0.32
Source Code Documentation
Log_files_dict Class Reference

In-memory dictionary of meta data of existing log files. More...

#include <log0files_dict.h>

Classes

class  Const_iterator
 

Public Member Functions

Log_files_dict methods
 Log_files_dict (Log_files_context &files_ctx)
 Constructs an empty dictionary. More...
 
 Log_files_dict (Log_files_dict &&other)
 
Log_files_dictoperator= (Log_files_dict &&other)
 
const Log_files_contextctx () const
 
Const_iterator find (lsn_t lsn) const
 Searches for an existing log file, that contains the provided lsn. More...
 
Const_iterator file (Log_file_id file_id) const
 Provides log file for the given file id. More...
 
void clear ()
 Clears the whole dictionary. More...
 
void erase (Log_file_id file_id)
 Removes the meta data about the given log file (which denotes the file does not exist anymore) from this data structure. More...
 
void add (Log_file_id file_id, os_offset_t size_in_bytes, lsn_t start_lsn, bool full, bool consumed, Encryption_metadata &encryption_metadata)
 Add meta data for the existing log file. More...
 
void add (Log_file_id file_id, os_offset_t size_in_bytes, lsn_t start_lsn, bool full, Encryption_metadata &encryption_metadata)
 Add meta data for the existing log file. More...
 
void set_consumed (Log_file_id file_id)
 Marks a given log file as consumed. More...
 
void set_full (Log_file_id file_id)
 Marks a given log file as full. More...
 
void set_incomplete (Log_file_id file_id)
 Marks a given log file as incomplete (undo marking as full). More...
 
void set_size (Log_file_id file_id, os_offset_t new_size)
 Changes size of the file. More...
 
bool empty () const
 
const Log_filefront () const
 
const Log_fileback () const
 
Log_files_dict::Const_iterator and related
Const_iterator begin () const
 
Const_iterator end () const
 

Private Types

using Log_files_map = ut::map< Log_file_id, Log_file >
 
using Log_files_map_iterator = typename Log_files_map::const_iterator
 

Private Attributes

const Log_files_contextm_files_ctx
 Context within which log files exist. More...
 
Log_files_map m_files_by_id
 Meta information about each existing redo log file. More...
 

Detailed Description

In-memory dictionary of meta data of existing log files.

This is a plain data structure only. It has no dependency.

Member Typedef Documentation

◆ Log_files_map

◆ Log_files_map_iterator

using Log_files_dict::Log_files_map_iterator = typename Log_files_map::const_iterator
private

Constructor & Destructor Documentation

◆ Log_files_dict() [1/2]

Log_files_dict::Log_files_dict ( Log_files_context files_ctx)
explicit

Constructs an empty dictionary.

◆ Log_files_dict() [2/2]

Log_files_dict::Log_files_dict ( Log_files_dict &&  other)

Member Function Documentation

◆ add() [1/2]

void Log_files_dict::add ( Log_file_id  file_id,
os_offset_t  size_in_bytes,
lsn_t  start_lsn,
bool  full,
bool  consumed,
Encryption_metadata encryption_metadata 
)

Add meta data for the existing log file.

It asserts that the meta data for that file has not been added yet to this data structure.

See also
Log_file_handle::m_encryption_metadata
Parameters
[in]file_idid of the log file
[in]size_in_bytessize of the log file (in bytes)
[in]start_lsnlsn of the first data byte in file
[in]fulltrue iff file is marked as full
[in]consumedtrue iff file is marked as consumed
[in]encryption_metadataencryption metadata

◆ add() [2/2]

void Log_files_dict::add ( Log_file_id  file_id,
os_offset_t  size_in_bytes,
lsn_t  start_lsn,
bool  full,
Encryption_metadata encryption_metadata 
)

Add meta data for the existing log file.

It asserts that the meta data for that file has not been added yet to this data structure.

See also
Log_file_handle::m_encryption_metadata
Parameters
[in]file_idid of the log file
[in]size_in_bytessize of the log file (in bytes)
[in]start_lsnlsn of the first data byte in file
[in]fulltrue iff file is marked as full
[in]encryption_metadataencryption metadata

◆ back()

const Log_file & Log_files_dict::back ( ) const
Returns
the newest redo log file

◆ begin()

Log_files_dict::Const_iterator Log_files_dict::begin ( void  ) const
Returns
iterator to the first log file (with the smallest id)

◆ clear()

void Log_files_dict::clear ( )

Clears the whole dictionary.

◆ ctx()

const Log_files_context & Log_files_dict::ctx ( ) const
Returns
context within which files exist

◆ empty()

bool Log_files_dict::empty ( ) const
Returns
true iff structure is empty

◆ end()

Log_files_dict::Const_iterator Log_files_dict::end ( void  ) const
Returns
iterator after the last log file

◆ erase()

void Log_files_dict::erase ( Log_file_id  file_id)

Removes the meta data about the given log file (which denotes the file does not exist anymore) from this data structure.

Parameters
[in]file_idid of the log file

◆ file()

Log_files_dict::Const_iterator Log_files_dict::file ( Log_file_id  file_id) const

Provides log file for the given file id.

Parameters
[in]file_idid of the log file
Returns
pointer to the log file

◆ find()

Log_files_dict::Const_iterator Log_files_dict::find ( lsn_t  lsn) const

Searches for an existing log file, that contains the provided lsn.

Parameters
[in]lsnlsn to search for
Return values
iteratorpointing to the log file if file has been found
end()if there was no file containing the provided lsn

◆ front()

const Log_file & Log_files_dict::front ( ) const
Returns
the oldest redo log file

◆ operator=()

Log_files_dict & Log_files_dict::operator= ( Log_files_dict &&  other)

◆ set_consumed()

void Log_files_dict::set_consumed ( Log_file_id  file_id)

Marks a given log file as consumed.

Parameters
[in]file_idid of the log file

◆ set_full()

void Log_files_dict::set_full ( Log_file_id  file_id)

Marks a given log file as full.

Parameters
[in]file_idid of the log file

◆ set_incomplete()

void Log_files_dict::set_incomplete ( Log_file_id  file_id)

Marks a given log file as incomplete (undo marking as full).

Parameters
[in]file_idid of the log file

◆ set_size()

void Log_files_dict::set_size ( Log_file_id  file_id,
os_offset_t  new_size 
)

Changes size of the file.

Updates m_end_lsn accordingly.

Parameters
[in]file_idid of the log file
[in]new_sizenew size (expressed in bytes)

Member Data Documentation

◆ m_files_by_id

Log_files_map Log_files_dict::m_files_by_id
private

Meta information about each existing redo log file.

◆ m_files_ctx

const Log_files_context& Log_files_dict::m_files_ctx
private

Context within which log files exist.


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