MySQL 9.1.0
Source Code Documentation
|
Directories scanned during startup and the files discovered. More...
Public Types | |
using | Result = std::pair< std::string, Tablespace_files::Names * > |
Public Member Functions | |
Tablespace_dirs () | |
Constructor. More... | |
void | set_scan_dir (const std::string &directory, bool is_undo_dir=false) |
Normalize and save a directory to scan for IBD and IBU datafiles before recovery. More... | |
void | set_scan_dirs (const std::string &directories) |
Normalize and save a list of directories to scan for IBD and IBU datafiles before recovery. More... | |
dberr_t | scan () |
Discover tablespaces by reading the header from .ibd files. More... | |
void | clear () |
Clear all the tablespace file data but leave the list of scanned directories in place. More... | |
bool | erase_path (space_id_t space_id) |
Erase a space ID to filename mapping. More... | |
Result | find_by_id (space_id_t space_id) |
Result | find_by_num (space_id_t space_num, space_id_t &space_id) |
bool | contains (const std::string &path) const |
Determine if this Fil_path contains the path provided. More... | |
std::string | get_dirs () const |
Get the list of directories that InnoDB knows about. More... | |
Private Types | |
using | Scanned = std::vector< Tablespace_files > |
first=dir path from the user, second=files found under first. More... | |
using | Const_iter = Scanned_files::const_iterator |
Private Member Functions | |
void | print_duplicates (const Space_id_set &duplicates) |
Print the duplicate filenames for a tablespace ID to the log. More... | |
void | warn_ignore (std::string path_in, const char *reason) |
Report a warning that a path is being ignored and include the reason. More... | |
void | add_path (const std::string &str, bool is_undo_dir=false) |
Add a single path specification to this list of tablespace directories. More... | |
void | add_paths (const std::string &str, const std::string &delimiters) |
Add a delimited list of path specifications to this list of tablespace directories. More... | |
void | duplicate_check (const Const_iter &start, const Const_iter &end, size_t thread_id, std::mutex *mutex, Space_id_set *unique, Space_id_set *duplicates) |
Check for duplicate tablespace IDs. More... | |
Private Attributes | |
Scanned | m_dirs |
Directories scanned and the files discovered under them. More... | |
std::atomic_size_t | m_checked |
Number of files checked. More... | |
Directories scanned during startup and the files discovered.
|
private |
using Tablespace_dirs::Result = std::pair<std::string, Tablespace_files::Names *> |
|
private |
first=dir path from the user, second=files found under first.
|
inline |
Constructor.
|
private |
Add a single path specification to this list of tablespace directories.
Convert it to an absolute path. Check if the path is valid. Ignore unreadable, duplicate or invalid directories.
[in] | str | Path specification to tokenize |
[in] | is_undo_dir | true for an undo directory |
|
private |
Add a delimited list of path specifications to this list of tablespace directories.
Convert relative paths to absolute paths. Check if the paths are valid. Ignore unreadable, duplicate or invalid directories.
[in] | str | Path specification to tokenize |
[in] | delimiters | Delimiters |
|
inline |
Clear all the tablespace file data but leave the list of scanned directories in place.
|
inline |
Determine if this Fil_path contains the path provided.
[in] | path | file or directory path to compare. |
|
private |
Check for duplicate tablespace IDs.
[in] | start | Start of slice |
[in] | end | End of slice |
[in] | thread_id | Thread ID |
[in,out] | mutex | Mutex protecting the global state |
[in,out] | unique | To check for duplicates |
[in,out] | duplicates | Duplicate space IDs found |
|
inline |
Erase a space ID to filename mapping.
[in] | space_id | Tablespace ID to erase |
|
inline |
|
inline |
|
inline |
Get the list of directories that InnoDB knows about.
|
private |
Print the duplicate filenames for a tablespace ID to the log.
Print the duplicate filenames for a tablespce ID to the log.
[in] | duplicates | Duplicate tablespace IDs |
dberr_t Tablespace_dirs::scan | ( | ) |
Discover tablespaces by reading the header from .ibd files.
void Tablespace_dirs::set_scan_dir | ( | const std::string & | directory, |
bool | is_undo_dir = false |
||
) |
Normalize and save a directory to scan for IBD and IBU datafiles before recovery.
[in] | directory | directory to scan for ibd and ibu files |
[in] | is_undo_dir | true for an undo directory |
void Tablespace_dirs::set_scan_dirs | ( | const std::string & | directories | ) |
Normalize and save a list of directories to scan for IBD and IBU datafiles before recovery.
[in] | directories | Directories to scan for ibd and ibu files |
|
private |
Report a warning that a path is being ignored and include the reason.
|
private |
Number of files checked.
|
private |
Directories scanned and the files discovered under them.