MySQL 26.7.0
Source Code Documentation
ib::fsp::Tablespace< TNode > Class Template Reference

Data structure that contains the information about an InnoDB tablespace. More...

#include <fsp0space.h>

Public Member Functions

 Tablespace (space_id_t space_id, fil_type_t space_type)
 
virtual ~Tablespace ()
 
 Tablespace (const Tablespace &)=delete
 
Tablespaceoperator= (const Tablespace &)=delete
 
const TNode & node (size_t order) const
 
fil_type_t space_type () const
 Get tablespace type. More...
 
void set_name (const char *name)
 Set tablespace name. More...
 
const char * name () const
 Get tablespace name. More...
 
void set_path (const std::string &path)
 Set tablespace path. More...
 
const std::string & path () const
 Get tablespace path. More...
 
void set_space_id (space_id_t space_id)
 Set the space id of the tablespace. More...
 
space_id_t space_id () const
 Get the space id of the tablespace. More...
 
void set_flags (uint32_t fsp_flags)
 Set the tablespace flags. More...
 
uint32_t flags () const
 Get the tablespace flags. More...
 
page_no_t get_sum_of_expected_sizes_in_pages () const
 
std::vector< size_t > delete_files ()
 Delete all the data files. More...
 
bool intersects (const Tablespace &other_space)
 Check if two tablespaces have common data file names. More...
 
void add_datafile (const char *node_path)
 Use the ADD DATAFILE path to create a node object and add it to the front of m_nodes. More...
 
bool is_read_only () const
 Determines if the current tablespace should be opened for read-only. More...
 
size_t get_nodes_count () const
 Returns the number of nodes the tablespace contains. More...
 
std::string get_node_full_path (size_t node_order=0) const
 Returns a full path to the node. More...
 
std::string get_node_full_path (const Tablespace_node &node) const
 Returns a full path to the node. More...
 
void set_autoextend_size (uint64_t size)
 
uint64_t get_autoextend_size () const
 

Protected Attributes

ut::vector< TNode > m_nodes
 Data nodes information used in this tablespace, in the correct order. More...
 

Private Member Functions

bool find (std::string_view node_name)
 

Private Attributes

char * m_name = nullptr
 Name of the tablespace. More...
 
space_id_t m_space_id {SPACE_UNKNOWN}
 Tablespace ID. More...
 
std::string m_path
 Path where tablespace files will reside, not including a filename. More...
 
uint32_t m_flags
 Tablespace flags. More...
 
uint64_t m_autoextend_size
 Autoextend size. More...
 
const fil_type_t m_space_type
 Type of the tablespace. More...
 

Detailed Description

template<typename TNode = Tablespace_node>
class ib::fsp::Tablespace< TNode >

Data structure that contains the information about an InnoDB tablespace.

Constructor & Destructor Documentation

◆ Tablespace() [1/2]

template<typename TNode = Tablespace_node>
ib::fsp::Tablespace< TNode >::Tablespace ( space_id_t  space_id,
fil_type_t  space_type 
)
inline

◆ ~Tablespace()

template<typename TNode = Tablespace_node>
virtual ib::fsp::Tablespace< TNode >::~Tablespace ( )
inlinevirtual

◆ Tablespace() [2/2]

template<typename TNode = Tablespace_node>
ib::fsp::Tablespace< TNode >::Tablespace ( const Tablespace< TNode > &  )
delete

Member Function Documentation

◆ add_datafile()

template<typename TNode >
void ib::fsp::Tablespace< TNode >::add_datafile ( const char *  node_path)

Use the ADD DATAFILE path to create a node object and add it to the front of m_nodes.

Parse the node path into a path and a basename with extension 'ibd'. This datafile_path provided may be an absolute or relative path, but it must end with the extension .ibd and have a basename of at least 1 byte.

Set tablespace m_path member and add the first node with the path and filename to be extracted from node_path specified.

Parameters
[in]node_pathfull path of the tablespace node.

◆ delete_files()

template<typename TNode >
std::vector< size_t > ib::fsp::Tablespace< TNode >::delete_files

Delete all the data files.

Returns
Order of all files for which deletion succeeded.

◆ find()

template<typename TNode >
bool ib::fsp::Tablespace< TNode >::find ( std::string_view  node_name)
private
Parameters
[in]node_nameName to lookup in the data nodes.
Returns
true if the node name exists in the data nodes

◆ flags()

template<typename TNode = Tablespace_node>
uint32_t ib::fsp::Tablespace< TNode >::flags ( ) const
inline

Get the tablespace flags.

Returns
m_flags tablespace flags

◆ get_autoextend_size()

template<typename TNode = Tablespace_node>
uint64_t ib::fsp::Tablespace< TNode >::get_autoextend_size ( ) const
inline

◆ get_node_full_path() [1/2]

template<typename TNode = Tablespace_node>
std::string ib::fsp::Tablespace< TNode >::get_node_full_path ( const Tablespace_node node) const
inline

Returns a full path to the node.

Parameters
[in]nodeNode from the tablespace to query

◆ get_node_full_path() [2/2]

template<typename TNode = Tablespace_node>
std::string ib::fsp::Tablespace< TNode >::get_node_full_path ( size_t  node_order = 0) const
inline

Returns a full path to the node.

Parameters
[in]node_orderNumber of the node on the list of nodes in the tablespace to query

◆ get_nodes_count()

template<typename TNode = Tablespace_node>
size_t ib::fsp::Tablespace< TNode >::get_nodes_count ( ) const
inline

Returns the number of nodes the tablespace contains.

◆ get_sum_of_expected_sizes_in_pages()

template<typename TNode = Tablespace_node>
page_no_t ib::fsp::Tablespace< TNode >::get_sum_of_expected_sizes_in_pages ( ) const
inline
Returns
the sum of all the node sizes, in pages.

◆ intersects()

template<typename TNode >
bool ib::fsp::Tablespace< TNode >::intersects ( const Tablespace< TNode > &  other_space)

Check if two tablespaces have common data file names.

Parameters
[in]other_spaceTablespace to check against this.
Returns
true if they have the same data filenames and paths

◆ is_read_only()

template<typename TNode = Tablespace_node>
bool ib::fsp::Tablespace< TNode >::is_read_only ( ) const
inline

Determines if the current tablespace should be opened for read-only.

◆ name()

template<typename TNode = Tablespace_node>
const char * ib::fsp::Tablespace< TNode >::name ( ) const
inline

Get tablespace name.

Returns
tablespace name

◆ node()

template<typename TNode = Tablespace_node>
const TNode & ib::fsp::Tablespace< TNode >::node ( size_t  order) const
inline

◆ operator=()

template<typename TNode = Tablespace_node>
Tablespace & ib::fsp::Tablespace< TNode >::operator= ( const Tablespace< TNode > &  )
delete

◆ path()

template<typename TNode = Tablespace_node>
const std::string & ib::fsp::Tablespace< TNode >::path ( ) const
inline

Get tablespace path.

Returns
tablespace path

◆ set_autoextend_size()

template<typename TNode = Tablespace_node>
void ib::fsp::Tablespace< TNode >::set_autoextend_size ( uint64_t  size)
inline

◆ set_flags()

template<typename TNode = Tablespace_node>
void ib::fsp::Tablespace< TNode >::set_flags ( uint32_t  fsp_flags)
inline

Set the tablespace flags.

Parameters
[in]fsp_flagstablespace flags

◆ set_name()

template<typename TNode = Tablespace_node>
void ib::fsp::Tablespace< TNode >::set_name ( const char *  name)
inline

Set tablespace name.

Parameters
[in]nametablespace name

◆ set_path()

template<typename TNode = Tablespace_node>
void ib::fsp::Tablespace< TNode >::set_path ( const std::string &  path)
inline

Set tablespace path.

Parameters
[in]pathwhere tablespace nodes reside.

◆ set_space_id()

template<typename TNode = Tablespace_node>
void ib::fsp::Tablespace< TNode >::set_space_id ( space_id_t  space_id)
inline

Set the space id of the tablespace.

Parameters
[in]space_idtablespace ID to set

◆ space_id()

template<typename TNode = Tablespace_node>
space_id_t ib::fsp::Tablespace< TNode >::space_id ( ) const
inline

Get the space id of the tablespace.

Returns
m_space_id space id of the tablespace

◆ space_type()

template<typename TNode = Tablespace_node>
fil_type_t ib::fsp::Tablespace< TNode >::space_type ( ) const
inline

Get tablespace type.

Returns
tablespace type

Member Data Documentation

◆ m_autoextend_size

template<typename TNode = Tablespace_node>
uint64_t ib::fsp::Tablespace< TNode >::m_autoextend_size
private

Autoextend size.

◆ m_flags

template<typename TNode = Tablespace_node>
uint32_t ib::fsp::Tablespace< TNode >::m_flags
private

Tablespace flags.

◆ m_name

template<typename TNode = Tablespace_node>
char* ib::fsp::Tablespace< TNode >::m_name = nullptr
private

Name of the tablespace.

◆ m_nodes

template<typename TNode = Tablespace_node>
ut::vector<TNode> ib::fsp::Tablespace< TNode >::m_nodes
protected

Data nodes information used in this tablespace, in the correct order.

◆ m_path

template<typename TNode = Tablespace_node>
std::string ib::fsp::Tablespace< TNode >::m_path
private

Path where tablespace files will reside, not including a filename.

◆ m_space_id

template<typename TNode = Tablespace_node>
space_id_t ib::fsp::Tablespace< TNode >::m_space_id {SPACE_UNKNOWN}
private

Tablespace ID.

◆ m_space_type

template<typename TNode = Tablespace_node>
const fil_type_t ib::fsp::Tablespace< TNode >::m_space_type
private

Type of the tablespace.


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