MySQL 8.4.2
Source Code Documentation
Table_cache_manager Class Reference

Container class for all table cache instances in the system. More...

#include <table_cache.h>

Public Member Functions

bool init ()
 Initialize all instances of table cache to be used by server. More...
 
void destroy ()
 Destroy all instances of table cache which were used by server. More...
 
Table_cacheget_cache (THD *thd)
 Get instance of table cache to be used by particular connection. More...
 
uint cache_index (Table_cache *cache) const
 Get index for the table cache in container. More...
 
uint cached_tables ()
 Get total number of used and unused TABLE objects in all table caches. More...
 
void lock_all_and_tdc ()
 Acquire locks on all instances of table cache and table definition cache (i.e. More...
 
void unlock_all_and_tdc ()
 Release locks on all instances of table cache and table definition cache. More...
 
void assert_owner (THD *thd)
 Assert that caller owns lock on the table cache. More...
 
void assert_owner_all ()
 Assert that caller owns locks on all instances of table cache. More...
 
void assert_owner_all_and_tdc ()
 Assert that caller owns locks on all instances of table cache and table definition cache. More...
 
void free_table (THD *thd, enum_tdc_remove_table_type remove_type, TABLE_SHARE *share)
 Remove and free all or some (depending on parameter) TABLE objects for the table from all table cache instances. More...
 
void free_all_unused_tables ()
 Free all unused TABLE objects in all table cache instances. More...
 
void print_tables ()
 Print debug information for the contents of all table cache instances. More...
 

Static Public Attributes

static const int MAX_TABLE_CACHES = 64
 Maximum supported number of table cache instances. More...
 
static const int DEFAULT_MAX_TABLE_CACHES = 16
 Default number of table cache instances. More...
 

Private Attributes

Table_cache m_table_cache [MAX_TABLE_CACHES]
 An array of Table_cache instances. More...
 

Friends

class Table_cache_iterator
 

Detailed Description

Container class for all table cache instances in the system.

Member Function Documentation

◆ assert_owner()

void Table_cache_manager::assert_owner ( THD thd)

Assert that caller owns lock on the table cache.

Parameters
thdThread handle

◆ assert_owner_all()

void Table_cache_manager::assert_owner_all ( )

Assert that caller owns locks on all instances of table cache.

◆ assert_owner_all_and_tdc()

void Table_cache_manager::assert_owner_all_and_tdc ( )

Assert that caller owns locks on all instances of table cache and table definition cache.

◆ cache_index()

uint Table_cache_manager::cache_index ( Table_cache cache) const
inline

Get index for the table cache in container.

◆ cached_tables()

uint Table_cache_manager::cached_tables ( )

Get total number of used and unused TABLE objects in all table caches.

Note
Doesn't require acquisition of table cache locks if inexact number of tables is acceptable.

◆ destroy()

void Table_cache_manager::destroy ( )

Destroy all instances of table cache which were used by server.

◆ free_all_unused_tables()

void Table_cache_manager::free_all_unused_tables ( )

Free all unused TABLE objects in all table cache instances.

◆ free_table()

void Table_cache_manager::free_table ( THD thd,
enum_tdc_remove_table_type  remove_type,
TABLE_SHARE share 
)

Remove and free all or some (depending on parameter) TABLE objects for the table from all table cache instances.

Parameters
thdThread context
remove_typeType of removal.
See also
tdc_remove_table().
Parameters
shareTABLE_SHARE for the table to be removed.
Note
Caller should own LOCK_open and locks on all table cache instances.

◆ get_cache()

Table_cache * Table_cache_manager::get_cache ( THD thd)
inline

Get instance of table cache to be used by particular connection.

◆ init()

bool Table_cache_manager::init ( void  )

Initialize all instances of table cache to be used by server.

Return values
false- success.
true- failure.

◆ lock_all_and_tdc()

void Table_cache_manager::lock_all_and_tdc ( )

Acquire locks on all instances of table cache and table definition cache (i.e.

LOCK_open).

◆ print_tables()

void Table_cache_manager::print_tables ( )

Print debug information for the contents of all table cache instances.

◆ unlock_all_and_tdc()

void Table_cache_manager::unlock_all_and_tdc ( )

Release locks on all instances of table cache and table definition cache.

Friends And Related Function Documentation

◆ Table_cache_iterator

friend class Table_cache_iterator
friend

Member Data Documentation

◆ DEFAULT_MAX_TABLE_CACHES

const int Table_cache_manager::DEFAULT_MAX_TABLE_CACHES = 16
static

Default number of table cache instances.

◆ m_table_cache

Table_cache Table_cache_manager::m_table_cache[MAX_TABLE_CACHES]
private

An array of Table_cache instances.

Only the first table_cache_instances elements in it are used.

◆ MAX_TABLE_CACHES

const int Table_cache_manager::MAX_TABLE_CACHES = 64
static

Maximum supported number of table cache instances.


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