MySQL 26.7.0
Source Code Documentation
undo_truncate::Space_id_bank Class Reference

A bank of UNDO space ids which is a lock free repository for information about the space IDs used for undo tablespaces. More...

Classes

struct  Space_id_account
 The currently used undo space IDs for an undo space along with a boolean showing whether the undo space number is in use. More...
 

Public Member Functions

 Space_id_bank ()
 
 ~Space_id_bank ()
 
void use_space_id (space_id_t space_id)
 Note that the undo space number for a space ID is being used. More...
 
void unuse_space_id (space_id_t space_id)
 Mark an undo number associated with a given space_id as unused and available to be reused. More...
 
space_id_t use_next_space_id (space_id_t space_num)
 Mark that the given undo space number is being used and return the next available space_id for that space number. More...
 
space_id_t next_space_id (space_id_t space_id, space_id_t space_num)
 Given a valid undo space_id or SPACE_UNKNOWN, return the next space_id for the given space number. More...
 
space_id_t next_space_id (space_id_t space_id)
 Given a valid undo space_id, return the next space_id for that space number. More...
 
space_id_t get_next_available_space_id ()
 Return the next available undo space ID to be used for a new explicit undo tablespaces. More...
 
bool check_space_id_in_use (space_id_t space_num)
 Check if the space_id mapped to space_num is in use. More...
 
space_id_t get_current_space_id_for_num (space_id_t space_num)
 Return the current space id mapped to the space_num. More...
 

Private Attributes

Space_id_account m_accounts [FSP_MAX_UNDO_TABLESPACES]
 

Detailed Description

A bank of UNDO space ids which is a lock free repository for information about the space IDs used for undo tablespaces.

It is used during creation in order to assign an unused space number and during truncation in order to assign the next space_id within that space_number range.

It is initialized with the minimum value in the range so that if a new space ID is needed in that range the max space ID will be used first. As truncation occurs, the space_ids are assigned from max down to min.

Constructor & Destructor Documentation

◆ Space_id_bank()

undo_truncate::Space_id_bank::Space_id_bank ( )
inline

◆ ~Space_id_bank()

undo_truncate::Space_id_bank::~Space_id_bank ( )
inline

Member Function Documentation

◆ check_space_id_in_use()

bool undo_truncate::Space_id_bank::check_space_id_in_use ( space_id_t  space_num)
inline

Check if the space_id mapped to space_num is in use.

Parameters
[in]space_numundo tablespace number
Returns
true if in use

◆ get_current_space_id_for_num()

space_id_t undo_truncate::Space_id_bank::get_current_space_id_for_num ( space_id_t  space_num)
inline

Return the current space id mapped to the space_num.

Parameters
[in]space_numundo tablespace number
Returns
the tablespace ID mapped to space_num

◆ get_next_available_space_id()

space_id_t undo_truncate::Space_id_bank::get_next_available_space_id ( )

Return the next available undo space ID to be used for a new explicit undo tablespaces.

The slot will be marked as in-use.

Returns
next available undo space number if successful.
SPACE_UNKNOWN if failed

◆ next_space_id() [1/2]

space_id_t undo_truncate::Space_id_bank::next_space_id ( space_id_t  space_id)

Given a valid undo space_id, return the next space_id for that space number.

Parameters
[in]space_idundo tablespace ID
Returns
the next tablespace ID to use

◆ next_space_id() [2/2]

space_id_t undo_truncate::Space_id_bank::next_space_id ( space_id_t  space_id,
space_id_t  space_num 
)

Given a valid undo space_id or SPACE_UNKNOWN, return the next space_id for the given space number.

Parameters
[in]space_idundo tablespace ID
[in]space_numundo tablespace number
Returns
the next tablespace ID to use

◆ unuse_space_id()

void undo_truncate::Space_id_bank::unuse_space_id ( space_id_t  space_id)

Mark an undo number associated with a given space_id as unused and available to be reused.

This happens when the fil_space_t is closed associated with a drop undo tablespace.

Parameters
[in]space_idUndo Tablespace ID

◆ use_next_space_id()

space_id_t undo_truncate::Space_id_bank::use_next_space_id ( space_id_t  space_num)

Mark that the given undo space number is being used and return the next available space_id for that space number.

Parameters
[in]space_numundo tablespace number
Returns
the next tablespace ID to use

◆ use_space_id()

void undo_truncate::Space_id_bank::use_space_id ( space_id_t  space_id)

Note that the undo space number for a space ID is being used.

Put that space_id into the space_id_bank.

Parameters
[in]space_idundo tablespace number

Member Data Documentation

◆ m_accounts

Space_id_account undo_truncate::Space_id_bank::m_accounts[FSP_MAX_UNDO_TABLESPACES]
private

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