MySQL  8.0.12
Source Code Documentation
Rsegs Class Reference

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_tat (ulint slot)
 Find the rseg at the given slot in this vector. More...
 
trx_rseg_tfind (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 ()
 Get a shared lock on m_rsegs. More...
 
void s_unlock ()
 Get a shared lock on m_rsegs. More...
 
void x_lock ()
 Get a shared lock on m_rsegs. More...
 
void x_unlock ()
 Get a shared lock on m_rsegs. More...
 
void set_active ()
 
void set_inactive ()
 
bool is_active ()
 
bool is_inactive ()
 

Public Attributes

Rsegs_Vector m_rsegs
 std::vector of rollback segments More...
 

Private Attributes

rw_lock_tm_latch
 RW lock to protect m_rsegs vector, m_active, and each trx_rseg_t::trx_ref_count within it. More...
 
bool m_active
 If true, then these rollback segments can be allocated to new transactions. More...
 

Detailed Description

This is a wrapper for a std::vector of trx_rseg_t object pointers.

Constructor & Destructor Documentation

◆ Rsegs()

Rsegs::Rsegs ( )
inline

Default constructor.

◆ ~Rsegs()

Rsegs::~Rsegs ( )
inline

Member Function Documentation

◆ at()

trx_rseg_t* Rsegs::at ( ulint  slot)
inline

Find the rseg at the given slot in this vector.

Parameters
[in]slota slot within the vector.
Returns
an iterator to the end

◆ begin()

Rseg_Iterator Rsegs::begin ( void  )
inline

beginning iterator

Returns
an iterator to the first element

◆ clear()

void Rsegs::clear ( )

Clear the vector of cached rollback segments leaving the reserved space allocated.

◆ deinit()

void Rsegs::deinit ( void  )

De-initialize.

◆ end()

Rseg_Iterator Rsegs::end ( void  )
inline

ending iterator

Returns
an iterator to the end

◆ find()

trx_rseg_t * Rsegs::find ( ulint  rseg_id)

Find an rseg in the std::vector that uses the rseg_id given.

Parameters
[in]rseg_idA slot in a durable array such as the TRX_SYS page or RSEG_ARRAY page.
Returns
a pointer to an trx_rseg_t that uses the rseg_id.

◆ init()

void Rsegs::init ( void  )

Initialize.

◆ is_active()

bool Rsegs::is_active ( )
inline

◆ is_inactive()

bool Rsegs::is_inactive ( )
inline

◆ push_back()

void Rsegs::push_back ( trx_rseg_t rseg)
inline

Add rollback segment.

Parameters
[in]rsegrollback segment to add.

◆ s_lock()

void Rsegs::s_lock ( )
inline

Get a shared lock on m_rsegs.

◆ s_unlock()

void Rsegs::s_unlock ( )
inline

Get a shared lock on m_rsegs.

◆ set_active()

void Rsegs::set_active ( )
inline

◆ set_inactive()

void Rsegs::set_inactive ( )
inline

◆ size()

ulint Rsegs::size ( )
inline

Number of registered rsegs.

Returns
size of rseg list.

◆ sort()

void Rsegs::sort ( )
inline

Sort the vector on trx_rseg_t::id.

◆ x_lock()

void Rsegs::x_lock ( )
inline

Get a shared lock on m_rsegs.

◆ x_unlock()

void Rsegs::x_unlock ( )
inline

Get a shared lock on m_rsegs.

Member Data Documentation

◆ m_active

bool Rsegs::m_active
private

If true, then these rollback segments can be allocated to new transactions.

◆ m_latch

rw_lock_t* Rsegs::m_latch
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

◆ m_rsegs

Rsegs_Vector Rsegs::m_rsegs

std::vector of rollback segments


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