MySQL 26.7.0
Source Code Documentation
undo_truncate::Tablespaces Class Reference

List of undo tablespaces, each containing a list of rollback segments. More...

#include <trx0undo_trunc.h>

Public Member Functions

 Tablespaces ()
 
 ~Tablespaces ()
 
void init ()
 Initialize. More...
 
void deinit ()
 De-initialize. More...
 
void clear ()
 Clear the contents of the list of Tablespace objects. More...
 
ulint size ()
 Get the number of tablespaces tracked by this object. More...
 
bool empty ()
 See if the list of tablespaces is empty. More...
 
Tablespaceat (size_t pos)
 Get the Tablespace tracked at a position. More...
 
void add (Tablespace &ref_undo_space)
 Add a new undo_truncate::Tablespace to the back of the vector. More...
 
void drop (Tablespace *undo_space)
 Drop an existing explicit undo_truncate::Tablespace. More...
 
void drop (Tablespace &ref_undo_space)
 Drop an existing explicit undo_truncate::Tablespace. More...
 
bool contains (space_id_t num)
 Check if the given space_id is in the vector. More...
 
Tablespacefind (space_id_t num)
 Find the given space_num in the vector. More...
 
Tablespacefind_first_inactive_explicit (size_t *num_active)
 Find the first undo space that is marked inactive explicitly. More...
 
bool own_latch ()
 Determine if this thread owns a lock on m_latch. More...
 
void s_lock (ut::Location location)
 Get a shared lock on m_spaces. More...
 
void s_unlock ()
 Release a shared lock on m_spaces. More...
 
void x_lock (ut::Location location)
 Get an exclusive lock on m_spaces. More...
 
void x_unlock ()
 Release an exclusive lock on m_spaces. More...
 

Public Attributes

Tablespaces_Vector m_spaces
 

Private Types

using Tablespaces_Vector = std::vector< Tablespace *, ut::allocator< Tablespace * > >
 

Private Attributes

rw_lock_tm_latch
 RW lock to protect m_spaces. More...
 

Detailed Description

List of undo tablespaces, each containing a list of rollback segments.

Member Typedef Documentation

◆ Tablespaces_Vector

Constructor & Destructor Documentation

◆ Tablespaces()

undo_truncate::Tablespaces::Tablespaces ( )
inline

◆ ~Tablespaces()

undo_truncate::Tablespaces::~Tablespaces ( )
inline

Member Function Documentation

◆ add()

void undo_truncate::Tablespaces::add ( Tablespace ref_undo_space)

Add a new undo_truncate::Tablespace to the back of the vector.

The vector has been pre-allocated to 128 so read threads will not lose what is pointed to. If tablespace_name and file_name are standard names, they are optional.

Parameters
[in]ref_undo_spaceundo tablespace

◆ at()

Tablespace * undo_truncate::Tablespaces::at ( size_t  pos)
inline

Get the Tablespace tracked at a position.

◆ clear()

void undo_truncate::Tablespaces::clear ( )
inline

Clear the contents of the list of Tablespace objects.

This does not deallocate any memory.

◆ contains()

bool undo_truncate::Tablespaces::contains ( space_id_t  num)
inline

Check if the given space_id is in the vector.

Parameters
[in]numundo tablespace number
Returns
true if space_id is found, else false

◆ deinit()

void undo_truncate::Tablespaces::deinit ( void  )

De-initialize.

De-initialize the undo_truncate::Tablespaces object.

◆ drop() [1/2]

void undo_truncate::Tablespaces::drop ( Tablespace ref_undo_space)

Drop an existing explicit undo_truncate::Tablespace.

Parameters
[in]ref_undo_spacereference to undo space

◆ drop() [2/2]

void undo_truncate::Tablespaces::drop ( Tablespace undo_space)

Drop an existing explicit undo_truncate::Tablespace.

Parameters
[in]undo_spacepointer to undo space

◆ empty()

bool undo_truncate::Tablespaces::empty ( )
inline

See if the list of tablespaces is empty.

◆ find()

Tablespace * undo_truncate::Tablespaces::find ( space_id_t  num)
inline

Find the given space_num in the vector.

Parameters
[in]numundo tablespace number
Returns
pointer to an undo_truncate::Tablespace struct

◆ find_first_inactive_explicit()

Tablespace * undo_truncate::Tablespaces::find_first_inactive_explicit ( size_t *  num_active)
inline

Find the first undo space that is marked inactive explicitly.

Parameters
[in,out]num_activeIf there are no inactive_explicit spaces found, this will contain the number of active spaces found.
Returns
pointer to an undo_truncate::Tablespace struct

◆ init()

void undo_truncate::Tablespaces::init ( void  )

Initialize.

Initialize the undo_truncate::Tablespaces object.

Fix the size of the vector so that it will not do allocations for inserts. This way the contents can be read without using a latch.

◆ own_latch()

bool undo_truncate::Tablespaces::own_latch ( )
inline

Determine if this thread owns a lock on m_latch.

◆ s_lock()

void undo_truncate::Tablespaces::s_lock ( ut::Location  location)
inline

Get a shared lock on m_spaces.

◆ s_unlock()

void undo_truncate::Tablespaces::s_unlock ( )
inline

Release a shared lock on m_spaces.

◆ size()

ulint undo_truncate::Tablespaces::size ( )
inline

Get the number of tablespaces tracked by this object.

◆ x_lock()

void undo_truncate::Tablespaces::x_lock ( ut::Location  location)
inline

Get an exclusive lock on m_spaces.

◆ x_unlock()

void undo_truncate::Tablespaces::x_unlock ( )
inline

Release an exclusive lock on m_spaces.

Member Data Documentation

◆ m_latch

rw_lock_t* undo_truncate::Tablespaces::m_latch
private

RW lock to protect m_spaces.

x for adding elements, s for scanning, size() etc.

◆ m_spaces

Tablespaces_Vector undo_truncate::Tablespaces::m_spaces

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