CUBRID Engine  latest
mvcc_active_tran Struct Reference

#include <mvcc_active_tran.hpp>

Collaboration diagram for mvcc_active_tran:
Collaboration graph

Public Types

enum  copy_safety { copy_safety::THREAD_SAFE, copy_safety::THREAD_UNSAFE }
 

Public Member Functions

 mvcc_active_tran ()
 
 ~mvcc_active_tran ()
 
void initialize ()
 
void finalize ()
 
void reset ()
 
MVCCID get_bit_area_start_mvccid ()
 
bool is_active (MVCCID mvccid) const
 
void copy_to (mvcc_active_tran &dest, copy_safety safety) const
 
mvcc_active_tranoperator= (const mvcc_active_tran &other)=delete
 
MVCCID compute_highest_completed_mvccid () const
 
MVCCID compute_lowest_active_mvccid () const
 
void set_inactive_mvccid (MVCCID mvccid)
 
void reset_start_mvccid (MVCCID mvccid)
 
void reset_active_transactions ()
 
void check_valid () const
 

Private Types

using unit_type = std::uint64_t
 

Private Member Functions

size_t get_bit_offset (MVCCID mvccid) const
 
MVCCID get_mvccid (size_t bit_offset) const
 
unit_typeget_unit_of (size_t bit_offset) const
 
bool is_set (size_t bit_offset) const
 
size_t get_area_size () const
 
size_t get_bit_area_memsize () const
 
size_t get_long_tran_memsize () const
 
void remove_long_transaction (MVCCID mvccid)
 
void add_long_transaction (MVCCID mvccid)
 
void ltrim_area (size_t trim_size)
 
void set_bitarea_mvccid (MVCCID mvccid)
 
void cleanup_migrate_to_long_transations ()
 

Static Private Member Functions

static size_t long_tran_max_size ()
 
static size_t bit_size_to_unit_size (size_t bit_count)
 
static size_t units_to_bits (size_t unit_count)
 
static size_t units_to_bytes (size_t unit_count)
 
static unit_type get_mask_of (size_t bit_offset)
 

Private Attributes

unit_typem_bit_area
 
volatile MVCCID m_bit_area_start_mvccid
 
volatile size_t m_bit_area_length
 
MVCCIDm_long_tran_mvccids
 
volatile size_t m_long_tran_mvccids_length
 
bool m_initialized
 

Static Private Attributes

static const size_t BITAREA_MAX_SIZE = 500
 
static const size_t BYTE_BIT_COUNT = 8
 
static const size_t UNIT_BYTE_COUNT = sizeof (unit_type)
 
static const size_t UNIT_BIT_COUNT = UNIT_BYTE_COUNT * BYTE_BIT_COUNT
 
static const size_t BITAREA_MAX_MEMSIZE = BITAREA_MAX_SIZE * UNIT_BYTE_COUNT
 
static const size_t BITAREA_MAX_BITS = BITAREA_MAX_SIZE * UNIT_BIT_COUNT
 
static const unit_type ALL_ACTIVE = 0
 
static const unit_type ALL_COMMITTED = (unit_type) -1
 

Detailed Description

Definition at line 31 of file mvcc_active_tran.hpp.

Member Typedef Documentation

using mvcc_active_tran::unit_type = std::uint64_t
private

Definition at line 63 of file mvcc_active_tran.hpp.

Member Enumeration Documentation

Enumerator
THREAD_SAFE 
THREAD_UNSAFE 

Definition at line 37 of file mvcc_active_tran.hpp.

Constructor & Destructor Documentation

mvcc_active_tran::mvcc_active_tran ( )

Definition at line 29 of file mvcc_active_tran.cpp.

mvcc_active_tran::~mvcc_active_tran ( )

Definition at line 39 of file mvcc_active_tran.cpp.

References m_bit_area, and m_long_tran_mvccids.

Member Function Documentation

void mvcc_active_tran::add_long_transaction ( MVCCID  mvccid)
private

Definition at line 376 of file mvcc_active_tran.cpp.

References assert, long_tran_max_size(), m_long_tran_mvccids, and m_long_tran_mvccids_length.

Referenced by cleanup_migrate_to_long_transations().

Here is the caller graph for this function:

size_t mvcc_active_tran::bit_size_to_unit_size ( size_t  bit_count)
inlinestaticprivate

Definition at line 104 of file mvcc_active_tran.cpp.

References UNIT_BIT_COUNT.

Referenced by get_area_size().

Here is the caller graph for this function:

void mvcc_active_tran::cleanup_migrate_to_long_transations ( )
private

Definition at line 460 of file mvcc_active_tran.cpp.

References add_long_transaction(), ALL_COMMITTED, check_valid(), get_area_size(), get_mvccid(), i, ltrim_area(), m_bit_area, and UNIT_BIT_COUNT.

Referenced by set_bitarea_mvccid().

Here is the caller graph for this function:

MVCCID mvcc_active_tran::compute_highest_completed_mvccid ( ) const

Definition at line 170 of file mvcc_active_tran.cpp.

References assert, count_bits(), get_mvccid(), get_unit_of(), m_bit_area, m_bit_area_length, m_bit_area_start_mvccid, MVCCID_FIRST, NULL, UNIT_BIT_COUNT, and units_to_bits().

Referenced by mvcctable::build_mvcc_info().

Here is the caller graph for this function:

MVCCID mvcc_active_tran::compute_lowest_active_mvccid ( ) const
void mvcc_active_tran::finalize ( void  )

Definition at line 61 of file mvcc_active_tran.cpp.

References m_bit_area, m_initialized, m_long_tran_mvccids, and NULL.

Referenced by mvcc_trans_status::finalize(), logtb_finalize_mvcc_testing(), and logtb_free_tran_mvcc_info().

Here is the caller graph for this function:

size_t mvcc_active_tran::get_area_size ( ) const
private

Definition at line 152 of file mvcc_active_tran.cpp.

References bit_size_to_unit_size(), and m_bit_area_length.

Referenced by cleanup_migrate_to_long_transations(), get_bit_area_memsize(), ltrim_area(), and set_bitarea_mvccid().

Here is the caller graph for this function:

size_t mvcc_active_tran::get_bit_area_memsize ( ) const
private

Definition at line 158 of file mvcc_active_tran.cpp.

References get_area_size(), and units_to_bytes().

Referenced by copy_to(), ltrim_area(), and reset().

Here is the caller graph for this function:

MVCCID mvcc_active_tran::get_bit_area_start_mvccid ( )

Definition at line 92 of file mvcc_active_tran.cpp.

References m_bit_area_start_mvccid.

Referenced by mvcctable::complete_mvcc().

Here is the caller graph for this function:

size_t mvcc_active_tran::get_bit_offset ( MVCCID  mvccid) const
inlineprivate

Definition at line 128 of file mvcc_active_tran.cpp.

References m_bit_area_start_mvccid.

Referenced by is_active(), and set_bitarea_mvccid().

Here is the caller graph for this function:

size_t mvcc_active_tran::get_long_tran_memsize ( ) const
private

Definition at line 164 of file mvcc_active_tran.cpp.

References m_long_tran_mvccids_length.

Referenced by copy_to().

Here is the caller graph for this function:

mvcc_active_tran::unit_type mvcc_active_tran::get_mask_of ( size_t  bit_offset)
inlinestaticprivate

Definition at line 122 of file mvcc_active_tran.cpp.

Referenced by check_valid(), is_set(), and set_bitarea_mvccid().

Here is the caller graph for this function:

MVCCID mvcc_active_tran::get_mvccid ( size_t  bit_offset) const
inlineprivate

Definition at line 134 of file mvcc_active_tran.cpp.

References m_bit_area_start_mvccid.

Referenced by cleanup_migrate_to_long_transations(), compute_highest_completed_mvccid(), and compute_lowest_active_mvccid().

Here is the caller graph for this function:

mvcc_active_tran::unit_type * mvcc_active_tran::get_unit_of ( size_t  bit_offset) const
inlineprivate

Definition at line 140 of file mvcc_active_tran.cpp.

References m_bit_area, and UNIT_BIT_COUNT.

Referenced by check_valid(), compute_highest_completed_mvccid(), compute_lowest_active_mvccid(), is_set(), and set_bitarea_mvccid().

Here is the caller graph for this function:

bool mvcc_active_tran::is_active ( MVCCID  mvccid) const
bool mvcc_active_tran::is_set ( size_t  bit_offset) const
inlineprivate

Definition at line 146 of file mvcc_active_tran.cpp.

References get_mask_of(), and get_unit_of().

Referenced by is_active().

Here is the caller graph for this function:

size_t mvcc_active_tran::long_tran_max_size ( )
inlinestaticprivate

Definition at line 98 of file mvcc_active_tran.cpp.

References logtb_get_number_of_total_tran_indices().

Referenced by add_long_transaction(), initialize(), and set_bitarea_mvccid().

Here is the caller graph for this function:

void mvcc_active_tran::ltrim_area ( size_t  trim_size)
private
mvcc_active_tran& mvcc_active_tran::operator= ( const mvcc_active_tran other)
delete
void mvcc_active_tran::remove_long_transaction ( MVCCID  mvccid)
private

Definition at line 354 of file mvcc_active_tran.cpp.

References assert, check_valid(), i, m_long_tran_mvccids, and m_long_tran_mvccids_length.

Referenced by set_inactive_mvccid().

Here is the caller graph for this function:

void mvcc_active_tran::reset ( void  )

Definition at line 73 of file mvcc_active_tran.cpp.

References check_valid(), get_bit_area_memsize(), m_bit_area, m_bit_area_length, m_bit_area_start_mvccid, m_initialized, m_long_tran_mvccids_length, and MVCCID_NULL.

Referenced by mvcc_snapshot::reset().

Here is the caller graph for this function:

void mvcc_active_tran::reset_active_transactions ( )

Definition at line 516 of file mvcc_active_tran.cpp.

References BITAREA_MAX_MEMSIZE, m_bit_area, m_bit_area_length, and m_long_tran_mvccids_length.

Referenced by mvcctable::build_mvcc_info().

Here is the caller graph for this function:

void mvcc_active_tran::reset_start_mvccid ( MVCCID  mvccid)

Definition at line 505 of file mvcc_active_tran.cpp.

References check_valid(), m_bit_area_start_mvccid, and m_initialized.

Referenced by mvcctable::reset_start_mvccid().

Here is the caller graph for this function:

void mvcc_active_tran::set_bitarea_mvccid ( MVCCID  mvccid)
private
void mvcc_active_tran::set_inactive_mvccid ( MVCCID  mvccid)
size_t mvcc_active_tran::units_to_bits ( size_t  unit_count)
inlinestaticprivate

Definition at line 110 of file mvcc_active_tran.cpp.

References UNIT_BIT_COUNT.

Referenced by compute_highest_completed_mvccid(), and ltrim_area().

Here is the caller graph for this function:

size_t mvcc_active_tran::units_to_bytes ( size_t  unit_count)
inlinestaticprivate

Definition at line 116 of file mvcc_active_tran.cpp.

References UNIT_BYTE_COUNT.

Referenced by get_bit_area_memsize().

Here is the caller graph for this function:

Member Data Documentation

const unit_type mvcc_active_tran::ALL_ACTIVE = 0
staticprivate

Definition at line 74 of file mvcc_active_tran.hpp.

Referenced by check_valid(), and ltrim_area().

const unit_type mvcc_active_tran::ALL_COMMITTED = (unit_type) -1
staticprivate
const size_t mvcc_active_tran::BITAREA_MAX_BITS = BITAREA_MAX_SIZE * UNIT_BIT_COUNT
staticprivate

Definition at line 72 of file mvcc_active_tran.hpp.

Referenced by set_bitarea_mvccid().

const size_t mvcc_active_tran::BITAREA_MAX_MEMSIZE = BITAREA_MAX_SIZE * UNIT_BYTE_COUNT
staticprivate

Definition at line 71 of file mvcc_active_tran.hpp.

Referenced by reset_active_transactions().

const size_t mvcc_active_tran::BITAREA_MAX_SIZE = 500
staticprivate

Definition at line 65 of file mvcc_active_tran.hpp.

Referenced by check_valid(), initialize(), and ltrim_area().

const size_t mvcc_active_tran::BYTE_BIT_COUNT = 8
staticprivate

Definition at line 67 of file mvcc_active_tran.hpp.

bool mvcc_active_tran::m_initialized
private

Definition at line 89 of file mvcc_active_tran.hpp.

Referenced by copy_to(), finalize(), initialize(), reset(), and reset_start_mvccid().

volatile size_t mvcc_active_tran::m_long_tran_mvccids_length
private
const size_t mvcc_active_tran::UNIT_BYTE_COUNT = sizeof (unit_type)
staticprivate

Definition at line 68 of file mvcc_active_tran.hpp.

Referenced by units_to_bytes().


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