MySQL 8.0.39
Source Code Documentation
Tablespace_files Class Reference

Tablespace files discovered during startup. More...

Public Types

using Names = std::vector< std::string, ut::allocator< std::string > >
 
using Paths = std::unordered_map< space_id_t, Names >
 
using Undo_num2id = std::unordered_map< space_id_t, space_id_t >
 

Public Member Functions

 Tablespace_files (const std::string &dir)
 Default constructor. More...
 
size_t add (space_id_t space_id, const std::string &name)
 Add a space ID to filename mapping. More...
 
Namesfind_by_id (space_id_t space_id)
 Get the file names that map to a space ID. More...
 
Namesfind_by_num (space_id_t space_num, space_id_t &space_id)
 Get the file name that maps to an undo space number. 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
 

Private Attributes

Paths m_ibd_paths
 Mapping from tablespace ID to data filenames. More...
 
Paths m_undo_paths
 Mapping from tablespace ID to Undo files. More...
 
Undo_num2id m_undo_nums
 Mapping from undo space number to space ID. More...
 
Fil_path m_dir
 Top level directory where the above files were found. More...
 

Detailed Description

Tablespace files discovered during startup.

Member Typedef Documentation

◆ Names

using Tablespace_files::Names = std::vector<std::string, ut::allocator<std::string> >

◆ Paths

using Tablespace_files::Paths = std::unordered_map<space_id_t, Names>

◆ Undo_num2id

using Tablespace_files::Undo_num2id = std::unordered_map<space_id_t, space_id_t>

Constructor & Destructor Documentation

◆ Tablespace_files()

Tablespace_files::Tablespace_files ( const std::string &  dir)
explicit

Default constructor.

Constructor.

Parameters
[in]dirDirectory that the files are under

Member Function Documentation

◆ add()

size_t Tablespace_files::add ( space_id_t  space_id,
const std::string &  name 
)

Add a space ID to filename mapping.

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

◆ clear()

void Tablespace_files::clear ( )
inline

Clear all the tablespace data.

◆ erase_path()

bool Tablespace_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()

Names * Tablespace_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

◆ find_by_num()

Names * Tablespace_files::find_by_num ( space_id_t  space_num,
space_id_t space_id 
)
inline

Get the file name that maps to an undo space number.

Parameters
[in]space_numundo tablespace number
[out]space_idundo tablespace ID
Returns
the file name that maps to the space number

◆ path()

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

◆ root()

const Fil_path & Tablespace_files::root ( ) const
inline
Returns
m_dir

Member Data Documentation

◆ m_dir

Fil_path Tablespace_files::m_dir
private

Top level directory where the above files were found.

◆ m_ibd_paths

Paths Tablespace_files::m_ibd_paths
private

Mapping from tablespace ID to data filenames.

◆ m_undo_nums

Undo_num2id Tablespace_files::m_undo_nums
private

Mapping from undo space number to space ID.

◆ m_undo_paths

Paths Tablespace_files::m_undo_paths
private

Mapping from tablespace ID to Undo files.


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