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::Ranger::Range Class Referencefinal

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

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

Classes

class  MetaRegOnAddReq
 
class  MetaRegOnLoadReq
 
struct  TaskRunQueueAdd
 
struct  TaskRunQueueScan
 

Public Types

enum  State : uint8_t {
  NOTLOADED,
  LOADING,
  LOADED,
  UNLOADING,
  DELETED
}
 

Public Member Functions

 Range (const ColumnCfg::Ptr &cfg, const rid_t rid)
 
void init ()
 
 ~Range () noexcept
 
std::string get_path (const std::string suff) const
 
std::string get_path_cs (const csid_t csid) const
 
std::string get_path_cs_on (const std::string folder, const csid_t csid) const
 
void set_rgr (int &err) const noexcept
 
void remove_rgr (int &err) const noexcept
 
uint24_t known_interval_count ()
 
void get_interval (DB::Cells::Interval &interval)
 
bool can_be_merged ()
 
void _get_interval (DB::Cells::Interval &interval) const
 
void _get_interval (DB::Cell::Key &key_begin, DB::Cell::Key &key_end) const
 
bool _is_any_begin () const
 
bool _is_any_end () const
 
void schema_update (bool compact)
 
void set_state (State new_state)
 
void reset_load_revision ()
 
int64_t get_load_revision ()
 
bool is_loaded ()
 
bool deleted ()
 
void state (int &err) const
 
bool state_unloading () const noexcept
 
void add (Callback::RangeQueryUpdate *req)
 
void scan (ReqScan::Ptr &&req)
 
void scan_internal (ReqScan::Ptr &&req)
 
void load (const Callback::RangeLoad::Ptr &req)
 
void internal_take_ownership (int &err, const Callback::RangeLoad::Ptr &req)
 
void internal_unload (bool completely, bool &chk_empty)
 
void issue_unload ()
 
void remove (const Callback::ColumnDelete::Ptr &req)
 
void internal_remove (int &err)
 
void wait_queue ()
 
bool compacting ()
 
bool compact_apply ()
 
void compacting (uint8_t state)
 
bool compacting_ifnot_applying (uint8_t state)
 
bool compact_possible (bool minor=true)
 
void compact_require (bool require)
 
bool compact_required ()
 
void apply_new (int &err, CellStore::Writers &w_cellstores, CommitLog::Fragments::Vec &fragments_old, const Query::Update::BaseMeta::Ptr &hdlr=nullptr)
 
void expand_and_align (bool w_chg_chk, const Query::Update::BaseMeta::Ptr &hdlr)
 
void internal_create_folders (int &err)
 
void internal_create (int &err, const CellStore::Writers &w_cellstores)
 
void internal_create (int &err, CellStore::Readers::Vec &mv_css)
 
void check_meta (const Query::Select::CheckMeta::Ptr &hdlr)
 
void print (std::ostream &out, bool minimal=true)
 

Public Attributes

const ColumnCfg::Ptr cfg
 
const rid_t rid
 
Blocks blocks
 
DB::Cell::Key prev_range_end
 

Static Public Attributes

static constexpr const char CELLSTORES_BAK_DIR [] = "cs_bak"
 
static constexpr const char CELLSTORES_RCVD_DIR [] = "cs_rcvd"
 
static constexpr const char CELLSTORES_TMP_DIR [] = "cs_tmp"
 
static constexpr const char LOG_TMP_DIR [] = "log_tmp"
 
static const uint8_t COMPACT_NONE = 0x00
 
static const uint8_t COMPACT_CHECKING = 0x01
 
static const uint8_t COMPACT_COMPACTING = 0x02
 
static const uint8_t COMPACT_PREPARING = 0x03
 
static const uint8_t COMPACT_APPLYING = 0x04
 

Private Member Functions

void last_rgr_chk (int &err, const Callback::RangeLoad::Ptr &req)
 
void load (int &err, const Callback::RangeLoad::Ptr &req)
 
void loaded (int err, const Callback::RangeLoad::Ptr &req)
 
void on_change (bool removal, const Query::Update::BaseMeta::Ptr &hdlr, const DB::Cell::Key *old_key_begin=nullptr)
 
bool wait (uint8_t from_state=COMPACT_CHECKING, bool incr=false)
 
void _run_scan_queue ()
 
void run_add_queue ()
 
void _run_add_queue ()
 

Private Attributes

const std::string m_path
 
Core::MutexAtomic m_mutex_intval
 
Core::MutexAtomic m_mutex_intval_alignment
 
DB::Cells::Interval m_interval
 
Core::Atomic< int64_t > m_load_revision
 
std::shared_mutex m_mutex
 
Core::Atomic< Statem_state
 
uint8_t m_compacting
 
Core::AtomicBool m_require_compact
 
bool m_q_run_add
 
bool m_q_run_scan
 
Core::Atomic< uint32_t > m_adding
 
Core::QueuePointer< Callback::RangeQueryUpdate * > m_q_add
 
Core::QueueSafe< ReqScan::Ptrm_q_scan
 
std::condition_variable_any m_cv
 

Detailed Description

Definition at line 27 of file Range.h.

Member Enumeration Documentation

◆ State

enum SWC::Ranger::Range::State : uint8_t
Enumerator
NOTLOADED 
LOADING 
LOADED 
UNLOADING 
DELETED 

Definition at line 42 of file Range.h.

Constructor & Destructor Documentation

◆ Range()

SWC_CAN_INLINE SWC::Ranger::Range::Range ( const ColumnCfg::Ptr cfg,
const rid_t  rid 
)

Definition at line 119 of file Range.cc.

References SWC::Env::Rgr::in_process_ranges().

+ Here is the call graph for this function:

◆ ~Range()

SWC::Ranger::Range::~Range ( )
noexcept

Definition at line 140 of file Range.cc.

References SWC::Env::Rgr::in_process_ranges().

+ Here is the call graph for this function:

Member Function Documentation

◆ _get_interval() [1/2]

SWC_CAN_INLINE void SWC::Ranger::Range::_get_interval ( DB::Cell::Key key_begin,
DB::Cell::Key key_end 
) const

Definition at line 214 of file Range.cc.

References SWC::DB::Cell::Key::copy(), SWC::DB::Cells::Interval::key_begin, SWC::DB::Cells::Interval::key_end, and m_interval.

+ Here is the call graph for this function:

◆ _get_interval() [2/2]

SWC_CAN_INLINE void SWC::Ranger::Range::_get_interval ( DB::Cells::Interval interval) const

Definition at line 209 of file Range.cc.

References SWC::DB::Cells::Interval::copy(), and m_interval.

Referenced by get_interval().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _is_any_begin()

SWC_CAN_INLINE bool SWC::Ranger::Range::_is_any_begin ( ) const

Definition at line 221 of file Range.cc.

References SWC::DB::Cell::Key::empty(), SWC::DB::Cells::Interval::key_begin, and m_interval.

Referenced by can_be_merged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _is_any_end()

SWC_CAN_INLINE bool SWC::Ranger::Range::_is_any_end ( ) const

Definition at line 226 of file Range.cc.

References SWC::DB::Cell::Key::empty(), SWC::DB::Cells::Interval::key_end, and m_interval.

+ Here is the call graph for this function:

◆ _run_add_queue()

void SWC::Ranger::Range::_run_add_queue ( )
private

Definition at line 1153 of file Range.cc.

References SWC::Ranger::Blocks::add_logged(), SWC::DB::Cells::Interval::align(), SWC::DB::KeySeq::align(), blocks, SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::cells_added, cfg, SWC::Error::COLUMN_MARKED_REMOVED, SWC::Ranger::CommitLog::Fragments::commit(), SWC::Ranger::Blocks::commitlog, COMPACT_PREPARING, SWC::DB::KeySeq::compare(), SWC::DB::Cell::Key::copy(), SWC::DB::Types::MngrColumn::DELETED, SWC::DB::Cell::Key::empty(), SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::err, SWC::Ranger::Callback::RangeQueryUpdate::ev, SWC::Ranger::Callback::RangeQueryUpdate::expired(), SWC::Core::Atomic< T, OrderT >::fetch_sub(), SWC::Condition::GT, SWC::DB::Cells::HAVE_TIMESTAMP, SWC::DB::Cells::Interval::key_end, m_adding, m_compacting, m_interval, m_mutex, m_mutex_intval_alignment, m_q_add, m_q_run_add, m_state, SWC::Ranger::Range::MetaRegOnAddReq::make(), SWC::DB::Types::MASTER, SWC::Time::now_ns(), on_change(), prev_range_end, SWC::Ranger::Blocks::processing_decrement(), SWC::Ranger::Blocks::processing_increment(), SWC::Error::RANGE_BAD_CELLS_INPUT, SWC::Error::RANGE_BAD_INTERVAL, SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::range_end, SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::range_prev_end, SWC::Error::REQUEST_TIMEOUT, SWC::Ranger::Callback::RangeQueryUpdate::response(), SWC::Error::RGR_NOT_LOADED_RANGE, SWC::Ranger::Callback::RangeQueryUpdate::rsp, run_add_queue(), and SWC_LOG_CURRENT_EXCEPTION.

+ Here is the call graph for this function:

◆ _run_scan_queue()

void SWC::Ranger::Range::_run_scan_queue ( )
private

Definition at line 306 of file Range.cc.

References blocks, COMPACT_APPLYING, m_compacting, m_mutex, m_q_run_scan, m_q_scan, SWC::Error::OK, SWC::Core::QueueSafe< ItemT >::pop(), SWC::Env::Rgr::post(), SWC::Ranger::Blocks::processing_decrement(), SWC::Ranger::Blocks::processing_increment(), state(), and SWC_CAN_INLINE.

+ Here is the call graph for this function:

◆ add()

SWC_CAN_INLINE void SWC::Ranger::Range::add ( Callback::RangeQueryUpdate req)

Definition at line 281 of file Range.cc.

References m_q_add, and run_add_queue().

+ Here is the call graph for this function:

◆ apply_new()

void SWC::Ranger::Range::apply_new ( int &  err,
CellStore::Writers w_cellstores,
CommitLog::Fragments::Vec fragments_old,
const Query::Update::BaseMeta::Ptr hdlr = nullptr 
)

Definition at line 690 of file Range.cc.

References SWC::Ranger::Blocks::apply_new(), blocks, expand_and_align(), and m_mutex.

+ Here is the call graph for this function:

◆ can_be_merged()

bool SWC::Ranger::Range::can_be_merged ( )

Definition at line 194 of file Range.cc.

References _is_any_begin(), blocks, SWC::Ranger::Blocks::cellstores, SWC::Ranger::Blocks::commitlog, COMPACT_NONE, SWC::Ranger::CommitLog::Fragments::empty(), m_compacting, m_mutex, m_mutex_intval, m_state, and SWC::Ranger::CellStore::Readers::size_bytes().

+ Here is the call graph for this function:

◆ check_meta()

◆ compact_apply()

SWC_CAN_INLINE bool SWC::Ranger::Range::compact_apply ( )

Definition at line 547 of file Range.cc.

References COMPACT_APPLYING, m_compacting, and m_mutex.

◆ compact_possible()

bool SWC::Ranger::Range::compact_possible ( bool  minor = true)

Definition at line 595 of file Range.cc.

References blocks, COMPACT_CHECKING, COMPACT_NONE, m_compacting, m_mutex, m_require_compact, m_state, and SWC::Ranger::Blocks::processing().

+ Here is the call graph for this function:

◆ compact_require()

SWC_CAN_INLINE void SWC::Ranger::Range::compact_require ( bool  require)

Definition at line 605 of file Range.cc.

References m_require_compact, and SWC::Core::AtomicBase< T, OrderT >::store().

Referenced by schema_update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compact_required()

SWC_CAN_INLINE bool SWC::Ranger::Range::compact_required ( )

Definition at line 610 of file Range.cc.

References m_require_compact.

◆ compacting() [1/2]

SWC_CAN_INLINE bool SWC::Ranger::Range::compacting ( )

Definition at line 541 of file Range.cc.

References COMPACT_NONE, m_compacting, and m_mutex.

◆ compacting() [2/2]

void SWC::Ranger::Range::compacting ( uint8_t  state)

Definition at line 552 of file Range.cc.

References COMPACT_APPLYING, COMPACT_PREPARING, m_compacting, m_cv, m_mutex, m_q_run_add, m_q_run_scan, SWC::Env::Rgr::post(), run_add_queue(), and state().

+ Here is the call graph for this function:

◆ compacting_ifnot_applying()

bool SWC::Ranger::Range::compacting_ifnot_applying ( uint8_t  state)

Definition at line 573 of file Range.cc.

References COMPACT_APPLYING, COMPACT_PREPARING, m_compacting, m_cv, m_mutex, m_q_run_add, m_q_run_scan, SWC::Env::Rgr::post(), run_add_queue(), and state().

+ Here is the call graph for this function:

◆ deleted()

SWC_CAN_INLINE bool SWC::Ranger::Range::deleted ( )

Definition at line 259 of file Range.cc.

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

◆ expand_and_align()

void SWC::Ranger::Range::expand_and_align ( bool  w_chg_chk,
const Query::Update::BaseMeta::Ptr hdlr 
)

Definition at line 704 of file Range.cc.

References SWC::DB::Cells::Interval::aligned_max, SWC::DB::Cells::Interval::aligned_min, blocks, cfg, SWC::DB::Cell::Key::copy(), SWC::DB::Cell::KeyVec::copy(), SWC::DB::Cell::Key::equal(), SWC::DB::Cell::KeyVec::equal(), SWC::Ranger::Blocks::expand(), SWC::Ranger::Blocks::expand_and_align(), SWC::DB::Cells::Interval::free(), SWC::DB::Cells::Interval::key_begin, SWC::DB::Cells::Interval::key_end, m_interval, m_mutex_intval, m_mutex_intval_alignment, SWC::DB::Types::MASTER, on_change(), and reset_load_revision().

Referenced by apply_new().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_interval()

SWC_CAN_INLINE void SWC::Ranger::Range::get_interval ( DB::Cells::Interval interval)

Definition at line 188 of file Range.cc.

References _get_interval(), m_mutex_intval, and m_mutex_intval_alignment.

+ Here is the call graph for this function:

◆ get_load_revision()

SWC_CAN_INLINE int64_t SWC::Ranger::Range::get_load_revision ( )

Definition at line 248 of file Range.cc.

References SWC::Core::AtomicBase< T, OrderT >::load(), and m_load_revision.

+ Here is the call graph for this function:

◆ get_path()

std::string SWC::Ranger::Range::get_path ( const std::string  suff) const

Definition at line 144 of file Range.cc.

References m_path.

Referenced by internal_create_folders(), internal_remove(), and load().

+ Here is the caller graph for this function:

◆ get_path_cs()

SWC_CAN_INLINE std::string SWC::Ranger::Range::get_path_cs ( const csid_t  csid) const

Definition at line 153 of file Range.cc.

References SWC::DB::RangeBase::CELLSTORES_DIR, and get_path_cs_on().

Referenced by internal_create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_path_cs_on()

SWC_CAN_INLINE std::string SWC::Ranger::Range::get_path_cs_on ( const std::string  folder,
const csid_t  csid 
) const

Definition at line 158 of file Range.cc.

References SWC::DB::RangeBase::get_path_cs(), and m_path.

Referenced by get_path_cs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

SWC_CAN_INLINE void SWC::Ranger::Range::init ( )

Definition at line 136 of file Range.cc.

References blocks, and SWC::Ranger::Blocks::init().

+ Here is the call graph for this function:

◆ internal_create() [1/2]

void SWC::Ranger::Range::internal_create ( int &  err,
CellStore::Readers::Vec mv_css 
)

Definition at line 780 of file Range.cc.

References blocks, SWC::Error::CANCELLED, SWC::Ranger::Blocks::cellstores, SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Ranger::CellStore::Readers::move_from(), SWC::Error::OK, remove_rgr(), SWC::Ranger::RangeData::save(), and set_rgr().

+ Here is the call graph for this function:

◆ internal_create() [2/2]

void SWC::Ranger::Range::internal_create ( int &  err,
const CellStore::Writers w_cellstores 
)

◆ internal_create_folders()

SWC_CAN_INLINE void SWC::Ranger::Range::internal_create_folders ( int &  err)

Definition at line 741 of file Range.cc.

References SWC::DB::RangeBase::CELLSTORES_DIR, get_path(), SWC::Env::FsInterface::interface(), SWC::DB::RangeBase::LOG_DIR, and LOG_TMP_DIR.

Referenced by load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ internal_remove()

void SWC::Ranger::Range::internal_remove ( int &  err)

◆ internal_take_ownership()

void SWC::Ranger::Range::internal_take_ownership ( int &  err,
const Callback::RangeLoad::Ptr req 
)

Definition at line 387 of file Range.cc.

References cfg, SWC::DB::RangeBase::get_path_ranger(), SWC::DB::Types::SystemColumn::is_rgr_data_on_fs(), load(), loaded(), SWC::LOG_DEBUG, m_path, SWC::Env::Rgr::post(), SWC::Env::Rgr::rgr_data(), rid, SWC::Error::SERVER_SHUTTING_DOWN, SWC::Common::Files::RgrData::set_rgr(), state_unloading(), SWC_CAN_INLINE, SWC_FMT_LU, and SWC_LOGF.

Referenced by last_rgr_chk(), and load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ internal_unload()

void SWC::Ranger::Range::internal_unload ( bool  completely,
bool &  chk_empty 
)

◆ is_loaded()

SWC_CAN_INLINE bool SWC::Ranger::Range::is_loaded ( )

Definition at line 253 of file Range.cc.

References m_mutex, and m_state.

Referenced by loaded().

+ Here is the caller graph for this function:

◆ issue_unload()

void SWC::Ranger::Range::issue_unload ( )

Definition at line 473 of file Range.cc.

References cfg, SWC::Env::Rgr::columns(), SWC::Ranger::Columns::get_column(), and rid.

+ Here is the call graph for this function:

◆ known_interval_count()

SWC_CAN_INLINE uint24_t SWC::Ranger::Range::known_interval_count ( )

Definition at line 180 of file Range.cc.

References SWC::DB::Cell::Key::count, SWC::DB::Cell::Key::empty(), SWC::DB::Cells::Interval::key_begin, SWC::DB::Cells::Interval::key_end, m_interval, and m_mutex_intval.

+ Here is the call graph for this function:

◆ last_rgr_chk()

void SWC::Ranger::Range::last_rgr_chk ( int &  err,
const Callback::RangeLoad::Ptr req 
)
private

Definition at line 811 of file Range.cc.

References cfg, SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::DB::RgrData::endpoints, SWC::Comm::equal_endpoints(), SWC::Env::Clients::get(), SWC::DB::RangeBase::get_path_ranger(), SWC::DB::RgrData::get_rgr(), SWC::Common::Files::RgrData::get_rgr(), SWC::Comm::has_endpoint(), internal_take_ownership(), SWC::DB::Types::SystemColumn::is_rgr_data_on_fs(), load(), SWC::LOG_DEBUG, m_path, SWC::Error::OK, SWC::Env::Rgr::post(), SWC::DB::RgrData::print(), SWC::Env::Rgr::rgr_data(), rid, SWC_CAN_INLINE, SWC_FMT_LU, SWC_LOG_OSTREAM, SWC_LOG_OUT, and SWC_LOGF.

Referenced by load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load() [1/2]

void SWC::Ranger::Range::load ( const Callback::RangeLoad::Ptr req)

Definition at line 357 of file Range.cc.

References blocks, CELLSTORES_BAK_DIR, SWC::DB::RangeBase::CELLSTORES_DIR, cfg, SWC::Core::AtomicBase< T, OrderT >::compare_exchange_weak(), SWC::Comm::Protocol::FsBroker::Handler::exists(), get_path(), SWC::Env::FsInterface::interface(), internal_create_folders(), internal_take_ownership(), last_rgr_chk(), loaded(), SWC::DB::Types::MngrColumn::LOADING, SWC::LOG_DEBUG, m_mutex, m_state, SWC::Error::OK, SWC::Ranger::Blocks::processing_increment(), rid, SWC::Error::SERVER_SHUTTING_DOWN, state_unloading(), SWC_FMT_LU, and SWC_LOGF.

Referenced by internal_take_ownership(), and last_rgr_chk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load() [2/2]

◆ loaded()

void SWC::Ranger::Range::loaded ( int  err,
const Callback::RangeLoad::Ptr req 
)
private

Definition at line 1054 of file Range.cc.

References blocks, is_loaded(), SWC::DB::Types::MngrColumn::LOADING, SWC::LOG_INFO, SWC::LOG_WARN, m_mutex, m_state, print(), SWC::Error::print(), SWC::Ranger::Blocks::processing_decrement(), reset_load_revision(), SWC::Error::RGR_NOT_LOADED_RANGE, SWC::Error::SERVER_SHUTTING_DOWN, state_unloading(), SWC::Core::AtomicBase< T, OrderT >::store(), SWC_LOG_OSTREAM, and SWC_LOG_OUT.

Referenced by check_meta(), internal_take_ownership(), and load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_change()

◆ print()

void SWC::Ranger::Range::print ( std::ostream &  out,
bool  minimal = true 
)

Definition at line 797 of file Range.cc.

References blocks, cfg, m_interval, m_load_revision, m_mutex_intval, m_mutex_intval_alignment, m_state, prev_range_end, SWC::DB::Cell::Key::print(), SWC::DB::Cells::Interval::print(), SWC::Ranger::Blocks::print(), rid, and SWC::Ranger::to_string().

Referenced by internal_remove(), and loaded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

void SWC::Ranger::Range::remove ( const Callback::ColumnDelete::Ptr req)

◆ remove_rgr()

void SWC::Ranger::Range::remove_rgr ( int &  err) const
noexcept

Definition at line 172 of file Range.cc.

References SWC::DB::RangeBase::get_path_ranger(), SWC::Env::FsInterface::interface(), SWC::DB::Types::SystemColumn::is_rgr_data_on_fs(), and SWC::DB::RgrData::remove().

Referenced by internal_create(), and internal_unload().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_load_revision()

SWC_CAN_INLINE void SWC::Ranger::Range::reset_load_revision ( )

Definition at line 243 of file Range.cc.

References m_load_revision, SWC::Time::now_ns(), and SWC::Core::AtomicBase< T, OrderT >::store().

Referenced by expand_and_align(), and loaded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run_add_queue()

void SWC::Ranger::Range::run_add_queue ( )
private

Definition at line 1100 of file Range.cc.

References SWC::Env::Rgr::cfg_req_add_concurrency, SWC::Core::Atomic< T, OrderT >::fetch_add(), SWC::Core::Atomic< T, OrderT >::fetch_sub(), SWC::Config::Property::Value_uint8_g::get(), SWC::Env::Rgr::get(), m_adding, and SWC::Env::Rgr::post().

Referenced by _run_add_queue(), add(), compacting(), and compacting_ifnot_applying().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scan()

void SWC::Ranger::Range::scan ( ReqScan::Ptr &&  req)

Definition at line 286 of file Range.cc.

References blocks, COMPACT_APPLYING, m_compacting, m_mutex, m_q_run_scan, m_q_scan, SWC::Ranger::Blocks::processing_decrement(), SWC::Ranger::Blocks::processing_increment(), SWC::Core::QueueSafe< ItemT >::push(), SWC::Core::QueueSafe< ItemT >::push_and_is_1st(), and SWC::Ranger::Blocks::scan().

+ Here is the call graph for this function:

◆ scan_internal()

SWC_CAN_INLINE void SWC::Ranger::Range::scan_internal ( ReqScan::Ptr &&  req)

Definition at line 353 of file Range.cc.

References blocks, and SWC::Ranger::Blocks::scan().

+ Here is the call graph for this function:

◆ schema_update()

SWC_CAN_INLINE void SWC::Ranger::Range::schema_update ( bool  compact)

Definition at line 231 of file Range.cc.

References blocks, compact_require(), and SWC::Ranger::Blocks::schema_update().

+ Here is the call graph for this function:

◆ set_rgr()

void SWC::Ranger::Range::set_rgr ( int &  err) const
noexcept

Definition at line 163 of file Range.cc.

References SWC::DB::RangeBase::get_path_ranger(), SWC::DB::Types::SystemColumn::is_rgr_data_on_fs(), SWC::Env::Rgr::rgr_data(), SWC::Common::Files::RgrData::set_rgr(), and SWC::DB::RgrData::set_rgr().

Referenced by internal_create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_state()

void SWC::Ranger::Range::set_state ( Range::State  new_state)

Definition at line 237 of file Range.cc.

References m_mutex, m_state, and SWC::Core::AtomicBase< T, OrderT >::store().

+ Here is the call graph for this function:

◆ state()

SWC_CAN_INLINE void SWC::Ranger::Range::state ( int &  err) const

Definition at line 265 of file Range.cc.

References SWC::Error::COLUMN_MARKED_REMOVED, SWC::DB::Types::MngrColumn::DELETED, m_state, and SWC::Error::RGR_NOT_LOADED_RANGE.

Referenced by _run_scan_queue(), compacting(), and compacting_ifnot_applying().

+ Here is the caller graph for this function:

◆ state_unloading()

SWC_CAN_INLINE bool SWC::Ranger::Range::state_unloading ( ) const
noexcept

Definition at line 274 of file Range.cc.

References cfg, SWC::DB::Types::SystemColumn::is_data(), SWC::Env::Rgr::is_not_accepting(), and SWC::Env::Rgr::is_shuttingdown().

Referenced by check_meta(), internal_take_ownership(), load(), and loaded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wait()

bool SWC::Ranger::Range::wait ( uint8_t  from_state = COMPACT_CHECKING,
bool  incr = false 
)
private

Definition at line 1084 of file Range.cc.

References blocks, m_compacting, m_cv, m_mutex, and SWC::Ranger::Blocks::processing_increment().

Referenced by internal_remove(), and internal_unload().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wait_queue()

void SWC::Ranger::Range::wait_queue ( )

Definition at line 535 of file Range.cc.

References SWC::Core::QueueSafe< ItemT >::empty(), m_adding, m_q_add, and m_q_scan.

Referenced by internal_remove(), and internal_unload().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ blocks

◆ CELLSTORES_BAK_DIR

constexpr const char SWC::Ranger::Range::CELLSTORES_BAK_DIR[] = "cs_bak"
staticconstexpr

◆ CELLSTORES_RCVD_DIR

constexpr const char SWC::Ranger::Range::CELLSTORES_RCVD_DIR[] = "cs_rcvd"
staticconstexpr

Definition at line 38 of file Range.h.

Referenced by SWC::Ranger::CellStore::Readers::load_from_path().

◆ CELLSTORES_TMP_DIR

constexpr const char SWC::Ranger::Range::CELLSTORES_TMP_DIR[] = "cs_tmp"
staticconstexpr

◆ cfg

◆ COMPACT_APPLYING

◆ COMPACT_CHECKING

const uint8_t SWC::Ranger::Range::COMPACT_CHECKING = 0x01
static

Definition at line 52 of file Range.h.

Referenced by compact_possible().

◆ COMPACT_COMPACTING

const uint8_t SWC::Ranger::Range::COMPACT_COMPACTING = 0x02
static

Definition at line 53 of file Range.h.

Referenced by SWC::Ranger::CommitLog::Fragments::try_compact().

◆ COMPACT_NONE

◆ COMPACT_PREPARING

◆ LOG_TMP_DIR

constexpr const char SWC::Ranger::Range::LOG_TMP_DIR[] = "log_tmp"
staticconstexpr

◆ m_adding

Core::Atomic<uint32_t> SWC::Ranger::Range::m_adding
private

Definition at line 196 of file Range.h.

Referenced by _run_add_queue(), run_add_queue(), and wait_queue().

◆ m_compacting

uint8_t SWC::Ranger::Range::m_compacting
private

◆ m_cv

std::condition_variable_any SWC::Ranger::Range::m_cv
private

Definition at line 200 of file Range.h.

Referenced by compacting(), compacting_ifnot_applying(), and wait().

◆ m_interval

◆ m_load_revision

Core::Atomic<int64_t> SWC::Ranger::Range::m_load_revision
private

Definition at line 185 of file Range.h.

Referenced by get_load_revision(), print(), and reset_load_revision().

◆ m_mutex

◆ m_mutex_intval

Core::MutexAtomic SWC::Ranger::Range::m_mutex_intval
private

◆ m_mutex_intval_alignment

Core::MutexAtomic SWC::Ranger::Range::m_mutex_intval_alignment
private

Definition at line 183 of file Range.h.

Referenced by _run_add_queue(), expand_and_align(), get_interval(), load(), on_change(), and print().

◆ m_path

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

Definition at line 181 of file Range.h.

Referenced by get_path(), get_path_cs_on(), internal_take_ownership(), and last_rgr_chk().

◆ m_q_add

Core::QueuePointer<Callback::RangeQueryUpdate*> SWC::Ranger::Range::m_q_add
private

Definition at line 197 of file Range.h.

Referenced by _run_add_queue(), add(), and wait_queue().

◆ m_q_run_add

bool SWC::Ranger::Range::m_q_run_add
private

Definition at line 193 of file Range.h.

Referenced by _run_add_queue(), compacting(), and compacting_ifnot_applying().

◆ m_q_run_scan

bool SWC::Ranger::Range::m_q_run_scan
private

Definition at line 194 of file Range.h.

Referenced by _run_scan_queue(), compacting(), compacting_ifnot_applying(), and scan().

◆ m_q_scan

Core::QueueSafe<ReqScan::Ptr> SWC::Ranger::Range::m_q_scan
private

Definition at line 198 of file Range.h.

Referenced by _run_scan_queue(), scan(), and wait_queue().

◆ m_require_compact

Core::AtomicBool SWC::Ranger::Range::m_require_compact
private

Definition at line 191 of file Range.h.

Referenced by compact_possible(), compact_require(), and compact_required().

◆ m_state

◆ prev_range_end

DB::Cell::Key SWC::Ranger::Range::prev_range_end

Definition at line 60 of file Range.h.

Referenced by _run_add_queue(), load(), and print().

◆ rid

const rid_t SWC::Ranger::Range::rid

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