#include <swcdb/ranger/db/Range.h>
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< State > | m_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::Ptr > | m_q_scan |
std::condition_variable_any | m_cv |
enum SWC::Ranger::Range::State : uint8_t |
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().
|
noexcept |
Definition at line 140 of file Range.cc.
References SWC::Env::Rgr::in_process_ranges().
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.
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().
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().
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.
|
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.
|
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.
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().
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.
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().
void SWC::Ranger::Range::check_meta | ( | const Query::Select::CheckMeta::Ptr & | hdlr | ) |
Definition at line 956 of file Range.cc.
References SWC::DB::Cells::Interval::aligned_max, SWC::DB::Cells::Interval::aligned_min, SWC::Core::Buffer< T >::base, cfg, SWC::DB::Cell::Key::copy(), SWC::DB::Specs::Timestamp::copy(), SWC::DB::Cell::KeyVec::decode(), SWC::DB::Cell::Key::decode(), SWC::Serialization::decode_vi64(), SWC::DB::Cells::DELETE_LE, SWC::DB::Cells::Interval::equal(), SWC::Error::get_text(), SWC::DB::Cells::Interval::key_begin, SWC::DB::Cells::Interval::key_end, loaded(), SWC::LOG_DEBUG, SWC::LOG_ERROR, m_interval, SWC::Ranger::Range::MetaRegOnLoadReq::make(), on_change(), SWC::DB::Cells::Interval::print(), SWC::DB::Cells::Result::print(), SWC::DB::Cell::KeyVec::remove(), SWC::DB::Cell::Key::remove(), rid, SWC::DB::Types::SERIAL, SWC::Error::SERVER_SHUTTING_DOWN, SWC::Core::Buffer< T >::size, SWC::DB::Cell::Serial::Value::skip_type_and_id(), state_unloading(), SWC_FMT_LU, SWC_LOG_CURRENT_EXCEPTION, SWC_LOG_OSTREAM, SWC_LOG_OUT, SWC_LOGF, SWC::DB::Cells::Interval::ts_earliest, SWC::DB::Cells::Interval::ts_latest, and SWC::DB::Cells::Interval::was_set.
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.
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().
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().
SWC_CAN_INLINE bool SWC::Ranger::Range::compact_required | ( | ) |
Definition at line 610 of file Range.cc.
References m_require_compact.
SWC_CAN_INLINE bool SWC::Ranger::Range::compacting | ( | ) |
Definition at line 541 of file Range.cc.
References COMPACT_NONE, m_compacting, and m_mutex.
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().
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().
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.
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().
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.
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.
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().
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().
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().
SWC_CAN_INLINE void SWC::Ranger::Range::init | ( | ) |
Definition at line 136 of file Range.cc.
References blocks, and SWC::Ranger::Blocks::init().
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().
void SWC::Ranger::Range::internal_create | ( | int & | err, |
const CellStore::Writers & | w_cellstores | ||
) |
Definition at line 750 of file Range.cc.
References SWC::Ranger::CellStore::Readers::add(), blocks, SWC::Ranger::Blocks::cellstores, get_path_cs(), SWC::Env::FsInterface::interface(), SWC::Ranger::CellStore::Read::make(), SWC::Error::OK, remove_rgr(), SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), SWC::Ranger::RangeData::save(), set_rgr(), and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().
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().
void SWC::Ranger::Range::internal_remove | ( | int & | err | ) |
Definition at line 514 of file Range.cc.
References blocks, cfg, SWC::Ranger::Blocks::commitlog, SWC::DB::Types::MngrColumn::DELETED, SWC::Core::AtomicBase< T, OrderT >::exchange(), get_path(), SWC::Env::FsInterface::interface(), SWC::LOG_DEBUG, SWC::LOG_INFO, m_mutex, m_state, print(), SWC::Ranger::Blocks::remove(), rid, SWC::Ranger::CommitLog::Fragments::stopping, SWC::Core::AtomicBase< T, OrderT >::store(), SWC_FMT_LU, SWC_LOG_OSTREAM, SWC_LOG_OUT, SWC_LOGF, wait(), and wait_queue().
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().
void SWC::Ranger::Range::internal_unload | ( | bool | completely, |
bool & | chk_empty | ||
) |
Definition at line 440 of file Range.cc.
References blocks, cfg, SWC::Ranger::Blocks::commitlog, SWC::Error::get_text(), SWC::LOG_DEBUG, SWC::LOG_INFO, m_mutex, m_state, SWC::Error::OK, SWC::Ranger::Blocks::range, remove_rgr(), rid, SWC::Ranger::Blocks::size_bytes_total(), SWC::Ranger::CommitLog::Fragments::stopping, SWC::Core::AtomicBase< T, OrderT >::store(), SWC_FMT_LU, SWC_LOGF, SWC::Ranger::Blocks::unload(), wait(), and wait_queue().
SWC_CAN_INLINE bool SWC::Ranger::Range::is_loaded | ( | ) |
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.
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.
|
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().
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().
|
private |
Definition at line 896 of file Range.cc.
References SWC::Ranger::CellStore::Readers::add(), blocks, SWC::Ranger::Blocks::cellstores, cfg, SWC::Ranger::CellStore::create_initial(), SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Ranger::Blocks::expand(), SWC::Ranger::Blocks::expand_and_align(), SWC::DB::Cells::Interval::free(), SWC::Ranger::CellStore::Readers::get_prev_key_end(), SWC::Ranger::Blocks::load(), SWC::Ranger::RangeData::load(), SWC::Ranger::CellStore::Readers::load_from_path(), loaded(), SWC::LOG_DEBUG, m_interval, m_mutex_intval, m_mutex_intval_alignment, SWC::Ranger::Range::MetaRegOnLoadReq::make(), SWC::DB::Types::MASTER, on_change(), prev_range_end, rid, SWC::Ranger::Query::Select::CheckMeta::run(), SWC::Ranger::RangeData::save(), SWC::Error::SERVER_SHUTTING_DOWN, state_unloading(), SWC_FMT_LU, and SWC_LOGF.
|
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().
|
private |
Definition at line 614 of file Range.cc.
References SWC::DB::Cell::Key::add(), SWC::DB::Cell::Serial::Value::FieldsWriter::add(), SWC::DB::Cells::Interval::aligned_max, SWC::DB::Cells::Interval::aligned_min, SWC::Core::Buffer< T >::base, cfg, SWC::DB::Cell::Key::copy(), SWC::DB::Cells::DELETE_LE, SWC::DB::Cell::Key::empty(), SWC::DB::Cell::Key::encoded_length(), SWC::Serialization::encoded_length_vi64(), SWC::Core::BufferDyn< BufferT >::ensure(), SWC::DB::Cell::Key::equal(), SWC::Core::BufferDyn< BufferT >::fill(), SWC::DB::Cells::Cell::flag, SWC::DB::Cells::Cell::free(), SWC::DB::Cells::INSERT, SWC::DB::Cell::Key::insert(), SWC::DB::Cells::Cell::key, SWC::DB::Cells::Interval::key_begin, SWC::DB::Cells::Interval::key_end, m_interval, m_mutex_intval_alignment, SWC::DB::Types::MASTER, rid, SWC::DB::Cells::Cell::set_time_order_desc(), SWC::DB::Cells::Cell::set_value(), SWC_ASSERT, and SWC::Ranger::to_string().
Referenced by _run_add_queue(), check_meta(), expand_and_align(), load(), and remove().
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().
void SWC::Ranger::Range::remove | ( | const Callback::ColumnDelete::Ptr & | req | ) |
Definition at line 480 of file Range.cc.
References blocks, cfg, SWC::Ranger::Blocks::commitlog, SWC::DB::Types::MngrColumn::DELETED, SWC::Core::AtomicBase< T, OrderT >::exchange(), SWC::Env::FsInterface::interface(), SWC::LOG_DEBUG, m_mutex, m_state, SWC::Ranger::Query::Update::CommonMeta::make(), SWC::Error::OK, on_change(), rid, SWC::Ranger::CommitLog::Fragments::stopping, SWC::Core::AtomicBase< T, OrderT >::store(), SWC_FMT_LU, and SWC_LOGF.
|
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().
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().
|
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().
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().
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().
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().
|
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().
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().
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().
|
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().
|
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().
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().
Blocks SWC::Ranger::Range::blocks |
Definition at line 59 of file Range.h.
Referenced by _run_add_queue(), _run_scan_queue(), apply_new(), can_be_merged(), compact_possible(), expand_and_align(), init(), internal_create(), internal_remove(), internal_unload(), load(), loaded(), print(), remove(), scan(), scan_internal(), schema_update(), and wait().
|
staticconstexpr |
Definition at line 37 of file Range.h.
Referenced by load(), SWC::Ranger::CellStore::Readers::load_from_path(), and SWC::Ranger::CellStore::Readers::replace().
|
staticconstexpr |
Definition at line 38 of file Range.h.
Referenced by SWC::Ranger::CellStore::Readers::load_from_path().
|
staticconstexpr |
Definition at line 39 of file Range.h.
Referenced by SWC::Ranger::CompactRange::create_cs(), SWC::Ranger::CompactRange::quit(), and SWC::Ranger::CellStore::Readers::replace().
const ColumnCfg::Ptr SWC::Ranger::Range::cfg |
Definition at line 57 of file Range.h.
Referenced by _run_add_queue(), check_meta(), expand_and_align(), internal_remove(), internal_take_ownership(), internal_unload(), issue_unload(), last_rgr_chk(), load(), on_change(), print(), remove(), and state_unloading().
|
static |
Definition at line 55 of file Range.h.
Referenced by _run_scan_queue(), compact_apply(), compacting(), compacting_ifnot_applying(), SWC::Ranger::CompactRange::finalize(), SWC::Ranger::CommitLog::Compact::finished(), SWC::Ranger::CompactRange::initialize(), SWC::Ranger::Column::internal_create(), SWC::Ranger::CompactRange::response(), and scan().
|
static |
Definition at line 52 of file Range.h.
Referenced by compact_possible().
|
static |
Definition at line 53 of file Range.h.
Referenced by SWC::Ranger::CommitLog::Fragments::try_compact().
|
static |
Definition at line 51 of file Range.h.
Referenced by can_be_merged(), SWC::Ranger::Compaction::compact(), compact_possible(), SWC::Ranger::Compaction::compacted(), compacting(), SWC::Ranger::CommitLog::Fragments::finish_compact(), SWC::Ranger::RangeSplit::run(), and SWC::Ranger::CompactRange::split().
|
static |
Definition at line 54 of file Range.h.
Referenced by _run_add_queue(), SWC::Ranger::CompactRange::commitlog_done(), compacting(), compacting_ifnot_applying(), SWC::Ranger::CompactRange::create_cs(), SWC::Ranger::CompactRange::initial_commitlog_done(), SWC::Ranger::CompactRange::progress_check_timer(), and SWC::Ranger::CommitLog::Fragments::try_compact().
|
staticconstexpr |
Definition at line 40 of file Range.h.
Referenced by SWC::Ranger::CommitLog::Compact::get_filepath(), and internal_create_folders().
|
private |
Definition at line 196 of file Range.h.
Referenced by _run_add_queue(), run_add_queue(), and wait_queue().
|
private |
Definition at line 190 of file Range.h.
Referenced by _run_add_queue(), _run_scan_queue(), can_be_merged(), compact_apply(), compact_possible(), compacting(), compacting_ifnot_applying(), scan(), and wait().
|
private |
Definition at line 200 of file Range.h.
Referenced by compacting(), compacting_ifnot_applying(), and wait().
|
private |
Definition at line 184 of file Range.h.
Referenced by _get_interval(), _is_any_begin(), _is_any_end(), _run_add_queue(), check_meta(), expand_and_align(), known_interval_count(), load(), on_change(), and print().
|
private |
Definition at line 185 of file Range.h.
Referenced by get_load_revision(), print(), and reset_load_revision().
|
private |
Definition at line 187 of file Range.h.
Referenced by _run_add_queue(), _run_scan_queue(), apply_new(), can_be_merged(), compact_apply(), compact_possible(), compacting(), compacting_ifnot_applying(), deleted(), internal_remove(), internal_unload(), is_loaded(), load(), loaded(), remove(), scan(), set_state(), and wait().
|
private |
Definition at line 182 of file Range.h.
Referenced by can_be_merged(), expand_and_align(), get_interval(), known_interval_count(), load(), and print().
|
private |
Definition at line 183 of file Range.h.
Referenced by _run_add_queue(), expand_and_align(), get_interval(), load(), on_change(), and print().
|
private |
Definition at line 181 of file Range.h.
Referenced by get_path(), get_path_cs_on(), internal_take_ownership(), and last_rgr_chk().
|
private |
Definition at line 197 of file Range.h.
Referenced by _run_add_queue(), add(), and wait_queue().
|
private |
Definition at line 193 of file Range.h.
Referenced by _run_add_queue(), compacting(), and compacting_ifnot_applying().
|
private |
Definition at line 194 of file Range.h.
Referenced by _run_scan_queue(), compacting(), compacting_ifnot_applying(), and scan().
|
private |
Definition at line 198 of file Range.h.
Referenced by _run_scan_queue(), scan(), and wait_queue().
|
private |
Definition at line 191 of file Range.h.
Referenced by compact_possible(), compact_require(), and compact_required().
|
private |
Definition at line 189 of file Range.h.
Referenced by _run_add_queue(), can_be_merged(), compact_possible(), deleted(), internal_remove(), internal_unload(), is_loaded(), load(), loaded(), print(), remove(), set_state(), and state().
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().
const rid_t SWC::Ranger::Range::rid |
Definition at line 58 of file Range.h.
Referenced by check_meta(), internal_remove(), internal_take_ownership(), internal_unload(), issue_unload(), last_rgr_chk(), load(), on_change(), print(), and remove().