CUBRID Engine  latest
mvcctable Class Reference

#include <mvcc_table.hpp>

Collaboration diagram for mvcctable:
Collaboration graph

Public Types

using lowest_active_mvccid_type = std::atomic< MVCCID >
 

Public Member Functions

 mvcctable ()
 
 ~mvcctable ()
 
void initialize ()
 
void finalize ()
 
void alloc_transaction_lowest_active ()
 
void reset_transaction_lowest_active (int tran_index)
 
void build_mvcc_info (log_tdes &tdes)
 
void complete_mvcc (int tran_index, MVCCID mvccid, bool committed)
 
void complete_sub_mvcc (MVCCID mvccid)
 
MVCCID get_new_mvccid ()
 
void get_two_new_mvccid (MVCCID &first, MVCCID &second)
 
bool is_active (MVCCID mvccid) const
 
void reset_start_mvccid ()
 
MVCCID get_global_oldest_visible () const
 
MVCCID update_global_oldest_visible ()
 
void lock_global_oldest_visible ()
 
void unlock_global_oldest_visible ()
 
bool is_global_oldest_visible_locked () const
 

Private Member Functions

mvcc_trans_statusnext_trans_status_start (mvcc_trans_status::version_type &next_version, size_t &next_index)
 
void next_tran_status_finish (mvcc_trans_status &next_trans_status, size_t next_index)
 
void advance_oldest_active (MVCCID next_oldest_active)
 
MVCCID compute_oldest_visible_mvccid () const
 

Private Attributes

lowest_active_mvccid_typem_transaction_lowest_visible_mvccids
 
size_t m_transaction_lowest_visible_mvccids_size
 
lowest_active_mvccid_type m_current_status_lowest_active_mvccid
 
mvcc_trans_status m_current_trans_status
 
std::atomic< size_t > m_trans_status_history_position
 
mvcc_trans_statusm_trans_status_history
 
std::mutex m_new_mvccid_lock
 
std::mutex m_active_trans_mutex
 
std::atomic< MVCCIDm_oldest_visible
 
std::atomic< size_t > m_ov_lock_count
 

Static Private Attributes

static const size_t HISTORY_MAX_SIZE = 2048
 
static const size_t HISTORY_INDEX_MASK = HISTORY_MAX_SIZE - 1
 

Detailed Description

Definition at line 64 of file mvcc_table.hpp.

Member Typedef Documentation

Definition at line 67 of file mvcc_table.hpp.

Constructor & Destructor Documentation

mvcctable::mvcctable ( )

Definition at line 162 of file mvcc_table.cpp.

mvcctable::~mvcctable ( )

Definition at line 176 of file mvcc_table.cpp.

References m_trans_status_history, and m_transaction_lowest_visible_mvccids.

Member Function Documentation

void mvcctable::advance_oldest_active ( MVCCID  next_oldest_active)
private

Definition at line 140 of file mvcc_table.cpp.

References oldest_active_event::ADVANCE_LOWEST, oldest_active_add_event(), and oldest_active_event::SET.

Referenced by complete_mvcc().

Here is the caller graph for this function:

void mvcctable::alloc_transaction_lowest_active ( )

Definition at line 198 of file mvcc_table.cpp.

References logtb_get_number_of_total_tran_indices(), m_transaction_lowest_visible_mvccids, and m_transaction_lowest_visible_mvccids_size.

Referenced by initialize(), and logtb_expand_trantable().

Here is the caller graph for this function:

void mvcctable::finalize ( void  )
MVCCID mvcctable::get_new_mvccid ( )

Definition at line 567 of file mvcc_table.cpp.

References log_global::hdr, log_Gl, m_new_mvccid_lock, log_header::mvcc_next_id, and MVCCID_FORWARD.

Referenced by logtb_get_current_mvccid(), and logtb_get_new_subtransaction_mvccid().

Here is the caller graph for this function:

void mvcctable::get_two_new_mvccid ( MVCCID first,
MVCCID second 
)

Definition at line 580 of file mvcc_table.cpp.

References log_global::hdr, log_Gl, m_new_mvccid_lock, log_header::mvcc_next_id, and MVCCID_FORWARD.

Referenced by logtb_get_new_subtransaction_mvccid().

Here is the caller graph for this function:

bool mvcctable::is_active ( MVCCID  mvccid) const
bool mvcctable::is_global_oldest_visible_locked ( ) const

Definition at line 646 of file mvcc_table.cpp.

References m_ov_lock_count.

Referenced by logtb_get_system_tdes().

Here is the caller graph for this function:

void mvcctable::lock_global_oldest_visible ( )

Definition at line 633 of file mvcc_table.cpp.

References m_ov_lock_count.

Referenced by logtb_get_system_tdes().

Here is the caller graph for this function:

void mvcctable::next_tran_status_finish ( mvcc_trans_status next_trans_status,
size_t  next_index 
)
private
mvcc_trans_status & mvcctable::next_trans_status_start ( mvcc_trans_status::version_type next_version,
size_t &  next_index 
)
private

Definition at line 442 of file mvcc_table.cpp.

References HISTORY_INDEX_MASK, m_current_trans_status, m_trans_status_history, m_trans_status_history_position, and mvcc_trans_status::m_version.

Referenced by complete_mvcc(), and complete_sub_mvcc().

Here is the caller graph for this function:

void mvcctable::reset_transaction_lowest_active ( int  tran_index)
void mvcctable::unlock_global_oldest_visible ( )

Definition at line 639 of file mvcc_table.cpp.

References assert, and m_ov_lock_count.

Referenced by logtb_get_system_tdes().

Here is the caller graph for this function:

MVCCID mvcctable::update_global_oldest_visible ( )

Definition at line 618 of file mvcc_table.cpp.

References assert, compute_oldest_visible_mvccid(), m_oldest_visible, and m_ov_lock_count.

Referenced by vacuum_data_load_and_recover(), and vacuum_data_unload_first_and_last_page().

Here is the caller graph for this function:

Member Data Documentation

const size_t mvcctable::HISTORY_INDEX_MASK = HISTORY_MAX_SIZE - 1
staticprivate

Definition at line 98 of file mvcc_table.hpp.

Referenced by next_trans_status_start().

const size_t mvcctable::HISTORY_MAX_SIZE = 2048
staticprivate

Definition at line 97 of file mvcc_table.hpp.

Referenced by build_mvcc_info(), initialize(), and reset_start_mvccid().

std::mutex mvcctable::m_active_trans_mutex
private

Definition at line 116 of file mvcc_table.hpp.

Referenced by complete_mvcc(), and complete_sub_mvcc().

lowest_active_mvccid_type mvcctable::m_current_status_lowest_active_mvccid
private
std::mutex mvcctable::m_new_mvccid_lock
private

Definition at line 114 of file mvcc_table.hpp.

Referenced by get_new_mvccid(), and get_two_new_mvccid().

std::atomic<MVCCID> mvcctable::m_oldest_visible
private

Definition at line 118 of file mvcc_table.hpp.

Referenced by get_global_oldest_visible(), and update_global_oldest_visible().

std::atomic<size_t> mvcctable::m_ov_lock_count
private
mvcc_trans_status* mvcctable::m_trans_status_history
private
std::atomic<size_t> mvcctable::m_trans_status_history_position
private
size_t mvcctable::m_transaction_lowest_visible_mvccids_size
private

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