MySQL 26.7.0
Source Code Documentation
ib::fil::Scanned_tablespace_dir_and_files Class Reference

A directory and tablespace files discovered under it during startup. More...

#include <fil0tablespace_scan.h>

Classes

struct  Space_read_info
 
struct  Space_scan_info
 Structure to represent space information collected after directory scanning. More...
 

Public Types

using Space_scan_infos = std::vector< Space_scan_info >
 
using Space_id_to_scan_info = std::unordered_map< space_id_t, Space_scan_infos >
 

Public Member Functions

 Scanned_tablespace_dir_and_files (const std::string &dir)
 Default constructor. More...
 
size_t add (Space_read_info space_info, const std::string &name)
 Add a space to filename mapping. More...
 
Space_scan_infosfind_by_id (space_id_t space_id)
 Get the file names that map to a space ID. More...
 
bool erase_path (space_id_t space_id)
 Remove the entry for the space ID. More...
 
void clear ()
 Clear all the tablespace data. More...
 
const Fil_pathroot () const
 
const std::string & path () const
 
void get_space_ids (std::vector< space_id_t > &space_ids)
 
void print_mapping ()
 

Private Attributes

Space_id_to_scan_info m_id_to_scan_info
 Mapping from tablespace ID to data filenames. More...
 
Fil_path m_dir
 Top level directory where the above files were found. More...
 

Detailed Description

A directory and tablespace files discovered under it during startup.

Member Typedef Documentation

◆ Space_id_to_scan_info

◆ Space_scan_infos

Constructor & Destructor Documentation

◆ Scanned_tablespace_dir_and_files()

ib::fil::Scanned_tablespace_dir_and_files::Scanned_tablespace_dir_and_files ( const std::string &  dir)
inlineexplicit

Default constructor.

Parameters
[in]dirDirectory that the files are under

Member Function Documentation

◆ add()

size_t ib::fil::Scanned_tablespace_dir_and_files::add ( Space_read_info  space_info,
const std::string &  name 
)

Add a space to filename mapping.

Parameters
[in]space_infoTablespace Info
[in]nameFile name.
Returns
number of files that map to the space ID

◆ clear()

void ib::fil::Scanned_tablespace_dir_and_files::clear ( )
inline

Clear all the tablespace data.

◆ erase_path()

bool ib::fil::Scanned_tablespace_dir_and_files::erase_path ( space_id_t  space_id)
inline

Remove the entry for the space ID.

Parameters
[in]space_idTablespace ID mapping to remove
Returns
true if erase successful

◆ find_by_id()

Space_scan_infos * ib::fil::Scanned_tablespace_dir_and_files::find_by_id ( space_id_t  space_id)
inline

Get the file names that map to a space ID.

Parameters
[in]space_idTablespace ID
Returns
the filenames that map to space id

◆ get_space_ids()

void ib::fil::Scanned_tablespace_dir_and_files::get_space_ids ( std::vector< space_id_t > &  space_ids)
inline

◆ path()

const std::string & ib::fil::Scanned_tablespace_dir_and_files::path ( ) const
inline
Returns
the directory path specified by the user.

◆ print_mapping()

void ib::fil::Scanned_tablespace_dir_and_files::print_mapping ( )
inline

◆ root()

const Fil_path & ib::fil::Scanned_tablespace_dir_and_files::root ( ) const
inline
Returns
m_dir

Member Data Documentation

◆ m_dir

Fil_path ib::fil::Scanned_tablespace_dir_and_files::m_dir
private

Top level directory where the above files were found.

◆ m_id_to_scan_info

Space_id_to_scan_info ib::fil::Scanned_tablespace_dir_and_files::m_id_to_scan_info
private

Mapping from tablespace ID to data filenames.

Note: The file names in m_id_to_scan_info are relative to m_dir.


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