MySQL 8.0.40
Source Code Documentation
ibt Namespace Reference

Classes

class  Tablespace
 Session Temporary tablespace. More...
 
class  Tablespace_pool
 Pool of session temporary tablespaces. More...
 

Enumerations

enum  tbsp_purpose { TBSP_NONE = 0 , TBSP_USER , TBSP_INTRINSIC , TBSP_SLAVE }
 Purpose for using tablespace. More...
 

Functions

dberr_t open_or_create (bool create_new_db)
 Create the session temporary tablespaces on startup. More...
 
void free_tmp (Tablespace *ts)
 Release a tablespace back to the pool. More...
 
void delete_pool_manager ()
 Delete the pool manager. More...
 
void close_files ()
 Close all files in the pool. More...
 
Tablespaceget_rpl_slave_tblsp ()
 
static dberr_t create_temp_dir ()
 Create the directory holding the temporary pool tablespaces. More...
 

Variables

class Tablespace_pooltbsp_pool = nullptr
 Pool of temporary tablespace. More...
 
char * srv_temp_dir = nullptr
 Server temp tablespaces directory, can be absolute path. More...
 
const uint32_t INIT_SIZE = 10
 The initial size of temporary tablespace pool. More...
 
const uint32_t POOL_EXPAND_SIZE = 10
 The number of tablespaces added to the pool every time the pool is expanded. More...
 
const uint32_t SLAVE_THREAD_ID = UINT32_MAX
 Thread id for the replication thread. More...
 
static const char DIR_NAME [] = "#innodb_temp"
 Directory to store the session temporary tablespaces. More...
 
static const char PREFIX_NAME [] = "temp_"
 Filename prefix to identify the session temporary tablespaces. More...
 
static std::string temp_tbsp_dir
 Directory name where session temporary tablespaces are stored. More...
 
static Tablespacerpl_slave_tblsp = nullptr
 Tablespace to be used by the replication thread. More...
 

Enumeration Type Documentation

◆ tbsp_purpose

Purpose for using tablespace.

Enumerator
TBSP_NONE 

Tablespace is not being used for any temporary table.

TBSP_USER 

Tablespace is used for user temporary tables.

TBSP_INTRINSIC 

Tablespace is used for intrinsic tables.

TBSP_SLAVE 

Tablespace is used by the slave node in a replication setup.

Function Documentation

◆ close_files()

void ibt::close_files ( )

Close all files in the pool.

◆ create_temp_dir()

static dberr_t ibt::create_temp_dir ( )
static

Create the directory holding the temporary pool tablespaces.

Returns
DB_SUCCESS in case of success and error if unable to create the directory

◆ delete_pool_manager()

void ibt::delete_pool_manager ( )

Delete the pool manager.

This should be called only on shutdown

◆ free_tmp()

void ibt::free_tmp ( Tablespace ts)

Release a tablespace back to the pool.

The tablespace will be truncated before adding back to pool

◆ get_rpl_slave_tblsp()

Tablespace * ibt::get_rpl_slave_tblsp ( )
Returns
a session tablespace dedicated for replication slave threads. Note this slave session tablespace could be used from many slave worker threads

◆ open_or_create()

dberr_t ibt::open_or_create ( bool  create_new_db)

Create the session temporary tablespaces on startup.

Parameters
[in]create_new_dbtrue if bootstrapping
Returns
DB_SUCCESS on success, else DB_ERROR on failure

Variable Documentation

◆ DIR_NAME

const char ibt::DIR_NAME[] = "#innodb_temp"
static

Directory to store the session temporary tablespaces.

Used when user doesn't provide a temporary tablespace dir

◆ INIT_SIZE

const uint32_t ibt::INIT_SIZE = 10

The initial size of temporary tablespace pool.

◆ POOL_EXPAND_SIZE

const uint32_t ibt::POOL_EXPAND_SIZE = 10

The number of tablespaces added to the pool every time the pool is expanded.

◆ PREFIX_NAME

const char ibt::PREFIX_NAME[] = "temp_"
static

Filename prefix to identify the session temporary tablespaces.

They are of pattern temp_*.ibt

◆ rpl_slave_tblsp

Tablespace* ibt::rpl_slave_tblsp = nullptr
static

Tablespace to be used by the replication thread.

◆ SLAVE_THREAD_ID

const uint32_t ibt::SLAVE_THREAD_ID = UINT32_MAX

Thread id for the replication thread.

◆ srv_temp_dir

char * ibt::srv_temp_dir = nullptr

Server temp tablespaces directory, can be absolute path.

◆ tbsp_pool

Tablespace_pool * ibt::tbsp_pool = nullptr

Pool of temporary tablespace.

◆ temp_tbsp_dir

std::string ibt::temp_tbsp_dir
static

Directory name where session temporary tablespaces are stored.

This location is decided after consulting srv_temp_dir