SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Manager::Range Class Referencefinal

#include <swcdb/manager/db/Range.h>

+ Inheritance diagram for SWC::Manager::Range:
+ Collaboration diagram for SWC::Manager::Range:

Public Types

typedef std::shared_ptr< RangePtr
 
using State = DB::Types::MngrRange::State
 

Public Member Functions

SWC_CAN_INLINE Range (const ColumnCfg::Ptr &a_cfg, const rid_t a_rid)
 
void init (int &)
 
 ~Range () noexcept
 
SWC_CAN_INLINE State state ()
 
SWC_CAN_INLINE bool deleted ()
 
SWC_CAN_INLINE bool assigned ()
 
SWC_CAN_INLINE bool queued ()
 
SWC_CAN_INLINE bool need_assign ()
 
SWC_CAN_INLINE bool assigned (rgrid_t rgrid)
 
bool need_health_check (int64_t ts, uint32_t ms, rgrid_t rgrid)
 
void set_state (State new_state, rgrid_t rgrid)
 
void set_state_none ()
 
void set_deleted ()
 
void set_state_queued (rgrid_t rgrid)
 
void set_state_assigned (rgrid_t rgrid, int64_t revision)
 
rgrid_t get_rgr_id ()
 
SWC_CAN_INLINE void set_rgr_id (rgrid_t rgrid)
 
const DB::RgrDataget_last_rgr ()
 
void set (const DB::Cells::Interval &intval, int64_t revision)
 
void get_interval (DB::Cell::Key &key_begin, DB::Cell::Key &key_end, int64_t &revision)
 
bool equal (const DB::Cells::Interval &intval)
 
bool includes (const DB::Cell::Key &range_begin, const DB::Cell::Key &range_end)
 
bool after (const Ptr &range)
 
SWC_CAN_INLINE bool before (const DB::Cell::Key &key)
 
void print (std::ostream &out)
 

Public Attributes

const ColumnCfg::Ptr cfg
 
const rid_t rid
 

Private Attributes

const std::string m_path
 
std::shared_mutex m_mutex
 
State m_state
 
int64_t m_check_ts
 
rgrid_t m_rgrid
 
std::unique_ptr< DB::RgrDatam_last_rgr
 
DB::Cell::Key m_key_begin
 
DB::Cell::Key m_key_end
 
int64_t m_load_revision
 

Detailed Description

Definition at line 21 of file Range.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Range> SWC::Manager::Range::Ptr

Definition at line 24 of file Range.h.

◆ State

Constructor & Destructor Documentation

◆ Range()

SWC_CAN_INLINE SWC::Manager::Range::Range ( const ColumnCfg::Ptr a_cfg,
const rid_t  a_rid 
)
inline

Definition at line 32 of file Range.h.

◆ ~Range()

SWC::Manager::Range::~Range ( )
inlinenoexcept

Definition at line 42 of file Range.h.

Member Function Documentation

◆ after()

bool SWC::Manager::Range::after ( const Ptr range)
inline

Definition at line 162 of file Range.h.

References m_key_end, and m_mutex.

◆ assigned() [1/2]

SWC_CAN_INLINE bool SWC::Manager::Range::assigned ( )
inline

Definition at line 57 of file Range.h.

References SWC::DB::Types::MngrRange::ASSIGNED, m_mutex, and m_state.

◆ assigned() [2/2]

SWC_CAN_INLINE bool SWC::Manager::Range::assigned ( rgrid_t  rgrid)
inline

Definition at line 75 of file Range.h.

References SWC::DB::Types::MngrRange::ASSIGNED, m_mutex, m_rgrid, and m_state.

◆ before()

SWC_CAN_INLINE bool SWC::Manager::Range::before ( const DB::Cell::Key key)
inline

Definition at line 168 of file Range.h.

References cfg, SWC::DB::KeySeq::compare(), SWC::DB::Cell::Key::empty(), SWC::Condition::GT, m_key_end, and m_mutex.

+ Here is the call graph for this function:

◆ deleted()

SWC_CAN_INLINE bool SWC::Manager::Range::deleted ( )
inline

Definition at line 51 of file Range.h.

References SWC::DB::Types::MngrColumn::DELETED, m_mutex, and m_state.

◆ equal()

bool SWC::Manager::Range::equal ( const DB::Cells::Interval intval)
inline

Definition at line 142 of file Range.h.

References SWC::DB::Cell::Key::equal(), SWC::DB::Cells::Interval::key_begin, SWC::DB::Cells::Interval::key_end, m_key_begin, m_key_end, and m_mutex.

+ Here is the call graph for this function:

◆ get_interval()

void SWC::Manager::Range::get_interval ( DB::Cell::Key key_begin,
DB::Cell::Key key_end,
int64_t &  revision 
)
inline

Definition at line 134 of file Range.h.

References SWC::DB::Cell::Key::copy(), m_key_begin, m_key_end, m_load_revision, and m_mutex.

+ Here is the call graph for this function:

◆ get_last_rgr()

const DB::RgrData & SWC::Manager::Range::get_last_rgr ( )

Definition at line 37 of file Range.cc.

References cfg, SWC::DB::RangeBase::get_path_ranger(), SWC::DB::RgrData::get_rgr(), SWC::Common::Files::RgrData::get_rgr(), SWC::DB::Types::SystemColumn::is_rgr_data_on_fs(), SWC::Env::Mngr::is_shuttingdown(), m_last_rgr, m_mutex, m_path, rid, and SWC::DB::RgrData::BaseSelector::valid().

+ Here is the call graph for this function:

◆ get_rgr_id()

rgrid_t SWC::Manager::Range::get_rgr_id ( )
inline

Definition at line 114 of file Range.h.

References m_mutex, and m_rgrid.

◆ includes()

bool SWC::Manager::Range::includes ( const DB::Cell::Key range_begin,
const DB::Cell::Key range_end 
)
inline

Definition at line 148 of file Range.h.

References cfg, SWC::DB::KeySeq::compare(), SWC::DB::Cell::Key::empty(), SWC::Condition::GT, SWC::Condition::LT, m_key_begin, m_key_end, and m_mutex.

+ Here is the call graph for this function:

◆ init()

void SWC::Manager::Range::init ( int &  )
inline

Definition at line 40 of file Range.h.

◆ need_assign()

SWC_CAN_INLINE bool SWC::Manager::Range::need_assign ( )
inline

Definition at line 69 of file Range.h.

References m_mutex, m_state, and SWC::DB::Types::MngrColumn::NOTSET.

◆ need_health_check()

bool SWC::Manager::Range::need_health_check ( int64_t  ts,
uint32_t  ms,
rgrid_t  rgrid 
)
inline

◆ print()

void SWC::Manager::Range::print ( std::ostream &  out)
inline

Definition at line 175 of file Range.h.

References cfg, m_load_revision, m_mutex, m_rgrid, m_state, rid, and SWC::DB::Types::to_string().

+ Here is the call graph for this function:

◆ queued()

SWC_CAN_INLINE bool SWC::Manager::Range::queued ( )
inline

Definition at line 63 of file Range.h.

References m_mutex, m_state, and SWC::DB::Types::MngrRange::QUEUED.

◆ set()

void SWC::Manager::Range::set ( const DB::Cells::Interval intval,
int64_t  revision 
)
inline

Definition at line 127 of file Range.h.

References SWC::DB::Cell::Key::copy(), SWC::DB::Cells::Interval::key_begin, SWC::DB::Cells::Interval::key_end, m_key_begin, m_key_end, m_load_revision, and m_mutex.

+ Here is the call graph for this function:

◆ set_deleted()

void SWC::Manager::Range::set_deleted ( )

Definition at line 19 of file Range.cc.

References SWC::Manager::Columns::assign_remove(), SWC::Env::Mngr::columns(), SWC::DB::Types::MngrColumn::DELETED, m_mutex, and m_state.

+ Here is the call graph for this function:

◆ set_rgr_id()

SWC_CAN_INLINE void SWC::Manager::Range::set_rgr_id ( rgrid_t  rgrid)
inline

Definition at line 120 of file Range.h.

References m_mutex, and m_rgrid.

◆ set_state()

void SWC::Manager::Range::set_state ( State  new_state,
rgrid_t  rgrid 
)
inline

Definition at line 90 of file Range.h.

References m_check_ts, m_load_revision, m_mutex, m_rgrid, and m_state.

Referenced by set_state_none().

+ Here is the caller graph for this function:

◆ set_state_assigned()

void SWC::Manager::Range::set_state_assigned ( rgrid_t  rgrid,
int64_t  revision 
)
inline

Definition at line 104 of file Range.h.

References SWC::DB::Types::MngrRange::ASSIGNED, m_check_ts, m_last_rgr, m_load_revision, m_mutex, m_rgrid, m_state, and SWC::Time::now_ms().

+ Here is the call graph for this function:

◆ set_state_none()

void SWC::Manager::Range::set_state_none ( )

Definition at line 14 of file Range.cc.

References SWC::Manager::Columns::assign_add(), SWC::Env::Mngr::columns(), SWC::DB::Types::MngrColumn::NOTSET, and set_state().

+ Here is the call graph for this function:

◆ set_state_queued()

void SWC::Manager::Range::set_state_queued ( rgrid_t  rgrid)

Definition at line 25 of file Range.cc.

References SWC::Manager::Columns::assign_remove(), SWC::Env::Mngr::columns(), m_check_ts, m_load_revision, m_mutex, m_rgrid, m_state, SWC::Time::now_ms(), and SWC::DB::Types::MngrRange::QUEUED.

+ Here is the call graph for this function:

◆ state()

SWC_CAN_INLINE State SWC::Manager::Range::state ( )
inline

Definition at line 45 of file Range.h.

References m_mutex, and m_state.

Member Data Documentation

◆ cfg

const ColumnCfg::Ptr SWC::Manager::Range::cfg

Definition at line 28 of file Range.h.

Referenced by before(), get_last_rgr(), includes(), and print().

◆ m_check_ts

int64_t SWC::Manager::Range::m_check_ts
private

Definition at line 190 of file Range.h.

Referenced by need_health_check(), set_state(), set_state_assigned(), and set_state_queued().

◆ m_key_begin

DB::Cell::Key SWC::Manager::Range::m_key_begin
private

Definition at line 194 of file Range.h.

Referenced by equal(), get_interval(), includes(), and set().

◆ m_key_end

DB::Cell::Key SWC::Manager::Range::m_key_end
private

Definition at line 195 of file Range.h.

Referenced by after(), before(), equal(), get_interval(), includes(), and set().

◆ m_last_rgr

std::unique_ptr<DB::RgrData> SWC::Manager::Range::m_last_rgr
private

Definition at line 192 of file Range.h.

Referenced by get_last_rgr(), and set_state_assigned().

◆ m_load_revision

int64_t SWC::Manager::Range::m_load_revision
private

Definition at line 196 of file Range.h.

Referenced by get_interval(), print(), set(), set_state(), set_state_assigned(), and set_state_queued().

◆ m_mutex

◆ m_path

const std::string SWC::Manager::Range::m_path
private

Definition at line 186 of file Range.h.

Referenced by get_last_rgr().

◆ m_rgrid

rgrid_t SWC::Manager::Range::m_rgrid
private

◆ m_state

State SWC::Manager::Range::m_state
private

◆ rid

const rid_t SWC::Manager::Range::rid

Definition at line 29 of file Range.h.

Referenced by get_last_rgr(), and print().


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