SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
Range.cc
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 
8 
9 
10 namespace SWC { namespace Manager {
11 
12 
13 
16  Env::Mngr::columns()->assign_add(shared_from_this());
17 }
18 
20  Env::Mngr::columns()->assign_remove(shared_from_this());
23 }
24 
26  Env::Mngr::columns()->assign_remove(shared_from_this());
27  int64_t ts = Time::now_ms();
30  m_rgrid = rgrid;
31  m_load_revision = 0;
32  m_check_ts = ts;
33 }
34 
35 
36 
38  class RgrDataHandler : public DB::RgrData::SyncSelector {
39  public:
40  RgrDataHandler() noexcept { }
41  virtual ~RgrDataHandler() noexcept { }
42  bool valid() noexcept override {
45  }
46  };
48  if(!m_last_rgr) {
49  m_last_rgr.reset(new DB::RgrData());
52  *m_last_rgr.get(),
54  )
56  DB::RgrData::SyncSelector::Ptr(new RgrDataHandler()),
57  *m_last_rgr.get(), cfg->cid, rid
58  );
59  }
60  return *m_last_rgr.get();
61 }
62 
63 
64 }}
Range.h
SWC::Manager::Range::m_mutex
std::shared_mutex m_mutex
Definition: Range.h:188
SWC::DB::Types::MngrColumn::NOTSET
@ NOTSET
Definition: MngrColumnState.h:17
SWC::DB::RgrData::SyncSelector::Ptr
std::shared_ptr< SyncSelector > Ptr
Definition: RgrData.h:302
SWC::Core::ScopedLock
Definition: MutexLock.h:41
SWC::Env::Mngr::columns
static SWC_CAN_INLINE Manager::Columns * columns() noexcept
Definition: MngrEnv.h:59
SWC::DB::RgrData::BaseSelector::valid
bool valid() noexcept override
Definition: RgrData.h:250
SWC::Manager::Range::set_state
void set_state(State new_state, rgrid_t rgrid)
Definition: Range.h:90
SWC::Manager::Range::rid
const rid_t rid
Definition: Range.h:29
SWC::Manager::Range::m_last_rgr
std::unique_ptr< DB::RgrData > m_last_rgr
Definition: Range.h:192
SWC::Manager::Columns::assign_remove
void assign_remove(const Range::Ptr &range)
Definition: Columns.h:175
SWC::Env::Mngr::is_shuttingdown
static SWC_CAN_INLINE bool is_shuttingdown() noexcept
Definition: MngrEnv.h:79
SWC::Manager::Range::cfg
const ColumnCfg::Ptr cfg
Definition: Range.h:28
SWC::Common::Files::RgrData::get_rgr
static void get_rgr(DB::RgrData &data, const std::string &filepath) noexcept
Definition: RgrData.h:83
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Manager::Range::m_rgrid
rgrid_t m_rgrid
Definition: Range.h:191
SWC::Manager::Range::m_path
const std::string m_path
Definition: Range.h:186
SWC::Manager::Range::set_state_queued
void set_state_queued(rgrid_t rgrid)
Definition: Range.cc:25
SWC::Manager::Columns::assign_add
void assign_add(Range::Ptr &&range)
Definition: Columns.h:167
SWC::Manager::Range::m_check_ts
int64_t m_check_ts
Definition: Range.h:190
SWC::Manager::Range::m_state
State m_state
Definition: Range.h:189
SWC::DB::Types::MngrRange::QUEUED
@ QUEUED
Definition: MngrRangeState.h:21
SWC::DB::RgrData::SyncSelector
Definition: RgrData.h:300
SWC::Manager::Range::set_deleted
void set_deleted()
Definition: Range.cc:19
SWC::DB::RangeBase::get_path_ranger
static std::string get_path_ranger(const std::string &range_path)
Definition: RangeBase.h:62
SWC::rgrid_t
uint64_t rgrid_t
Definition: Identifiers.h:18
SWC::DB::RgrData
Definition: RgrData.h:24
SWC::Time::now_ms
SWC_CAN_INLINE int64_t now_ms() noexcept
Definition: Time.h:36
SWC::DB::Types::MngrColumn::DELETED
@ DELETED
Definition: MngrColumnState.h:20
SWC::Manager::Range::set_state_none
void set_state_none()
Definition: Range.cc:14
SWC::Manager::Range::m_load_revision
int64_t m_load_revision
Definition: Range.h:196
SWC::Manager::Range::get_last_rgr
const DB::RgrData & get_last_rgr()
Definition: Range.cc:37
SWC::DB::Types::SystemColumn::is_rgr_data_on_fs
constexpr SWC_CAN_INLINE bool is_rgr_data_on_fs(cid_t cid) noexcept
Definition: SystemColumn.h:41
SWC::DB::RgrData::get_rgr
static void get_rgr(const SyncSelector::Ptr &hdlr, RgrData &data, cid_t cid, rid_t rid) noexcept
Definition: RgrData.h:318