MySQL 8.4.2
Source Code Documentation
Tablespace Class Reference

Data structure that contains the information about shared tablespaces. More...

#include <fsp0space.h>

Inheritance diagram for Tablespace:
[legend]

Public Types

typedef std::vector< Datafile, ut::allocator< Datafile > > files_t
 

Public Member Functions

 Tablespace ()
 
virtual ~Tablespace ()
 
 Tablespace (const Tablespace &)
 
Tablespaceoperator= (const Tablespace &)
 
void set_name (const char *name)
 Set tablespace name. More...
 
const char * name () const
 Get tablespace name. More...
 
void set_path (const char *path, size_t len)
 Set tablespace path and filename members. More...
 
void set_path (const char *path)
 Set tablespace path and filename members. More...
 
const char * 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...
 
void set_ignore_read_only (bool read_only_status)
 Set Ignore Read Only Status for tablespace. More...
 
void shutdown ()
 Free the memory allocated by the Tablespace object. More...
 
page_no_t get_sum_of_sizes () const
 
void delete_files ()
 Delete all the data files. More...
 
bool intersection (const Tablespace *other_space)
 Check if two tablespaces have common data file names. More...
 
dberr_t add_datafile (const char *datafile_added)
 Use the ADD DATAFILE path to create a Datafile object and add it to the front of m_files. More...
 
Datafilefirst_datafile ()
 
void set_autoextend_size (uint64_t size)
 
uint64_t get_autoextend_size () const
 

Public Attributes

files_t m_files
 Data file information - each Datafile can be accessed globally. More...
 

Protected Attributes

bool m_ignore_read_only
 Ignore server read only configuration for this tablespace. More...
 

Private Member Functions

bool find (const char *filename)
 Find a filename in the list of Datafiles for a tablespace. More...
 
void file_found (Datafile &file)
 Note that the data file was found. More...
 

Private Attributes

char * m_name
 Name of the tablespace. More...
 
space_id_t m_space_id
 Tablespace ID. More...
 
char * 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...
 

Detailed Description

Data structure that contains the information about shared tablespaces.

Currently this can be the system tablespace or a temporary table tablespace

Member Typedef Documentation

◆ files_t

Constructor & Destructor Documentation

◆ Tablespace() [1/2]

Tablespace::Tablespace ( )
inline

◆ ~Tablespace()

virtual Tablespace::~Tablespace ( )
inlinevirtual

◆ Tablespace() [2/2]

Tablespace::Tablespace ( const Tablespace )

Member Function Documentation

◆ add_datafile()

dberr_t Tablespace::add_datafile ( const char *  datafile_added)

Use the ADD DATAFILE path to create a Datafile object and add it to the front of m_files.

Parse the datafile 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 a Datafile with the filename.

Parameters
[in]datafile_addedfull path of the tablespace file.

◆ delete_files()

void Tablespace::delete_files ( )

Delete all the data files.

◆ file_found()

void Tablespace::file_found ( Datafile file)
private

Note that the data file was found.

Parameters
[in,out]fileData file object to set

◆ find()

bool Tablespace::find ( const char *  filename)
private

Find a filename in the list of Datafiles for a tablespace.

Parameters
[in]filenameName to lookup in the data files.
Returns
true if the filename exists in the data files
true if the filename exists in the data files

◆ first_datafile()

Datafile * Tablespace::first_datafile ( )
inline

◆ flags()

uint32_t Tablespace::flags ( ) const
inline

Get the tablespace flags.

Returns
m_flags tablespace flags

◆ get_autoextend_size()

uint64_t Tablespace::get_autoextend_size ( ) const
inline

◆ get_sum_of_sizes()

page_no_t Tablespace::get_sum_of_sizes ( ) const
inline
Returns
the sum of the file sizes of each Datafile

◆ intersection()

bool Tablespace::intersection ( const Tablespace 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

◆ name()

const char * Tablespace::name ( ) const
inline

Get tablespace name.

Returns
tablespace name

◆ operator=()

Tablespace & Tablespace::operator= ( const Tablespace )

◆ path()

const char * Tablespace::path ( ) const
inline

Get tablespace path.

Returns
tablespace path

◆ set_autoextend_size()

void Tablespace::set_autoextend_size ( uint64_t  size)
inline

◆ set_flags()

void Tablespace::set_flags ( uint32_t  fsp_flags)
inline

Set the tablespace flags.

Parameters
[in]fsp_flagstablespace flags

◆ set_ignore_read_only()

void Tablespace::set_ignore_read_only ( bool  read_only_status)
inline

Set Ignore Read Only Status for tablespace.

Parameters
[in]read_only_statusread only status indicator

◆ set_name()

void Tablespace::set_name ( const char *  name)
inline

Set tablespace name.

Parameters
[in]nametablespace name

◆ set_path() [1/2]

void Tablespace::set_path ( const char *  path)
inline

Set tablespace path and filename members.

Parameters
[in]pathwhere tablespace file(s) resides

◆ set_path() [2/2]

void Tablespace::set_path ( const char *  path,
size_t  len 
)
inline

Set tablespace path and filename members.

Parameters
[in]pathwhere tablespace file(s) resides
[in]lenlength of the file path

◆ set_space_id()

void Tablespace::set_space_id ( space_id_t  space_id)
inline

Set the space id of the tablespace.

Parameters
[in]space_idtablespace ID to set

◆ shutdown()

void Tablespace::shutdown ( )

Free the memory allocated by the Tablespace object.

Frees the memory allocated by the SysTablespace object.

◆ space_id()

space_id_t Tablespace::space_id ( ) const
inline

Get the space id of the tablespace.

Returns
m_space_id space id of the tablespace

Member Data Documentation

◆ m_autoextend_size

uint64_t Tablespace::m_autoextend_size
private

Autoextend size.

◆ m_files

files_t Tablespace::m_files

Data file information - each Datafile can be accessed globally.

◆ m_flags

uint32_t Tablespace::m_flags
private

Tablespace flags.

◆ m_ignore_read_only

bool Tablespace::m_ignore_read_only
protected

Ignore server read only configuration for this tablespace.

◆ m_name

char* Tablespace::m_name
private

Name of the tablespace.

◆ m_path

char* Tablespace::m_path
private

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

◆ m_space_id

space_id_t Tablespace::m_space_id
private

Tablespace ID.


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