MySQL 8.0.40
Source Code Documentation
|
This is a wrapper for a std::vector of trx_rseg_t object pointers. More...
#include <trx0types.h>
Public Member Functions | |
Rsegs () | |
Default constructor. More... | |
~Rsegs () | |
void | init () |
Initialize. More... | |
void | deinit () |
De-initialize. More... | |
void | clear () |
Clear the vector of cached rollback segments leaving the reserved space allocated. More... | |
void | push_back (trx_rseg_t *rseg) |
Add rollback segment. More... | |
ulint | size () |
Number of registered rsegs. More... | |
Rseg_Iterator | begin () |
beginning iterator More... | |
Rseg_Iterator | end () |
ending iterator More... | |
trx_rseg_t * | at (ulint slot) |
Find the rseg at the given slot in this vector. More... | |
trx_rseg_t * | find (ulint rseg_id) |
Find an rseg in the std::vector that uses the rseg_id given. More... | |
void | sort () |
Sort the vector on trx_rseg_t::id. More... | |
void | s_lock () |
Acquire the shared lock on m_rsegs. More... | |
void | s_unlock () |
Release the shared lock on m_rsegs. More... | |
void | x_lock () |
Acquire the exclusive lock on m_rsegs. More... | |
void | x_unlock () |
Release the exclusive lock on m_rsegs. More... | |
bool | is_active () |
Return whether the undo tablespace is active. More... | |
bool | is_inactive_implicit () |
Return whether the undo tablespace is inactive due to implicit selection by the purge thread. More... | |
bool | is_inactive_explicit () |
Return whether the undo tablespace was made inactive by ALTER TABLESPACE. More... | |
bool | is_empty () |
Return whether the undo tablespace is empty and ready to be dropped. More... | |
bool | is_init () |
Return whether the undo tablespace is being initialized. More... | |
void | set_active () |
Set the state of the rollback segments in this undo tablespace to ACTIVE for use by new transactions. More... | |
void | set_inactive_implicit () |
Set the state of the rollback segments in this undo tablespace to inactive_implicit. More... | |
void | set_inactive_explicit () |
Make the undo tablespace inactive so that it will not be used for new transactions. More... | |
void | set_empty () |
Set the state of the undo tablespace to empty so that it can be dropped. More... | |
Public Attributes | |
Rsegs_Vector | m_rsegs |
std::vector of rollback segments More... | |
Private Types | |
enum | undo_space_states { INIT , ACTIVE , INACTIVE_IMPLICIT , INACTIVE_EXPLICIT , EMPTY } |
Private Attributes | |
rw_lock_t * | m_latch |
RW lock to protect m_rsegs vector, m_active, and each trx_rseg_t::trx_ref_count within it. More... | |
undo_space_states | m_state |
The current state of this undo tablespace. More... | |
This is a wrapper for a std::vector of trx_rseg_t object pointers.
|
private |
|
inline |
Default constructor.
|
inline |
|
inline |
Find the rseg at the given slot in this vector.
[in] | slot | a slot within the vector. |
|
inline |
beginning iterator
void Rsegs::clear | ( | ) |
Clear the vector of cached rollback segments leaving the reserved space allocated.
void Rsegs::deinit | ( | void | ) |
De-initialize.
|
inline |
ending iterator
trx_rseg_t * Rsegs::find | ( | ulint | rseg_id | ) |
Find an rseg in the std::vector that uses the rseg_id given.
[in] | rseg_id | A slot in a durable array such as the TRX_SYS page or RSEG_ARRAY page. |
void Rsegs::init | ( | void | ) |
Initialize.
|
inline |
Return whether the undo tablespace is active.
|
inline |
Return whether the undo tablespace is empty and ready to be dropped.
|
inline |
Return whether the undo tablespace was made inactive by ALTER TABLESPACE.
|
inline |
Return whether the undo tablespace is inactive due to implicit selection by the purge thread.
|
inline |
Return whether the undo tablespace is being initialized.
|
inline |
Add rollback segment.
[in] | rseg | rollback segment to add. |
|
inline |
Acquire the shared lock on m_rsegs.
|
inline |
Release the shared lock on m_rsegs.
|
inline |
Set the state of the rollback segments in this undo tablespace to ACTIVE for use by new transactions.
|
inline |
Set the state of the undo tablespace to empty so that it can be dropped.
|
inline |
Make the undo tablespace inactive so that it will not be used for new transactions.
The purge thread will clear out all the undo logs, truncate it, and then mark it empty.
|
inline |
Set the state of the rollback segments in this undo tablespace to inactive_implicit.
This means that it will be truncated and then made active again by the purge thread. It will not be used for new transactions until it becomes active again.
|
inline |
Number of registered rsegs.
|
inline |
Sort the vector on trx_rseg_t::id.
|
inline |
Acquire the exclusive lock on m_rsegs.
|
inline |
Release the exclusive lock on m_rsegs.
|
private |
RW lock to protect m_rsegs vector, m_active, and each trx_rseg_t::trx_ref_count within it.
m_rsegs: x for adding elements, s for scanning, size etc. m_active: x for modification, s for read each trx_rseg_t::trx_ref_count within m_rsegs s and atomic increment for modification, x for read
Rsegs_Vector Rsegs::m_rsegs |
std::vector of rollback segments
|
private |
The current state of this undo tablespace.