|
SWC-DB
v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
|
Go to the documentation of this file.
7 #ifndef swcdb_manager_db_Column_h
8 #define swcdb_manager_db_Column_h
15 namespace SWC {
namespace Manager {
24 typedef std::shared_ptr<Column>
Ptr;
60 range->set_state_none();
107 for(
auto& range : *
this) {
108 if(range->assigned(rgrid)) {
123 for(
auto& range : *
this) {
124 if(range->rid == rid)
136 for(
auto& range : *
this) {
137 if(!range->includes(range_begin, range_end))
155 if(!range->equal(interval)) {
156 range->set(interval, revision);
160 if(range->rid == (*it)->rid) {
167 if((*it)->after(range)) {
185 if((*it)->rid == right->rid)
208 for(
auto& range : *
this) {
209 if(range->need_assign()) {
220 for(
auto& range : *
this) {
221 if(range->get_rgr_id() == rgrid) {
222 range->set_state_none();
232 for(
auto& range : *
this) {
233 if(range->get_rgr_id() == rgrid_old) {
234 range->set_rgr_id(rgrid);
239 int64_t rev = it->second;
259 if(it->second != rev)
269 return rev != it->second;
277 for(
auto& range : *
this) {
278 if(!(rgrid = range->get_rgr_id()))
280 if(std::find(rgrids.
cbegin(), rgrids.
cend(), rgrid) == rgrids.
cend())
301 rgrid_t rgrid = 0,
size_t max = 0) {
303 for(
auto& range : *
this) {
304 if(range->need_health_check(ts, ms, rgrid)) {
306 if(max && _ranges.
size() == max)
315 if(rid == (*it)->rid) {
316 (*it)->set_deleted();
331 for(
auto& range : *
this)
332 range->set_deleted();
345 if((eid = (*it)->get_rgr_id()) == rgrid || !eid)
368 cfg->print(out <<
'(');
371 for(
auto& range : *
this) {
387 for(
bool unused; ++rid; ) {
389 for(
auto& range : *
this) {
390 if(range->rid == rid) {
411 for(
auto& range : *
this) {
412 if(!range->assigned())
435 #endif // swcdb_manager_db_Column_h
SWC_CAN_INLINE iterator erase(size_type offset) noexcept(_NoExceptMoveAssign &&_NoExceptDestructor)
void apply_loaded_state()
constexpr SWC_CAN_INLINE bool compare_exchange_weak(T &at, T value) noexcept
bool finalize_remove(int &err, rgrid_t rgrid=0)
Range::Ptr create_new_range(rgrid_t rgrid)
std::shared_mutex m_mutex
bool need_health_check(int64_t ts, uint32_t ms)
static const char * get_column_path() noexcept
std::shared_ptr< Schema > Ptr
SWC_CAN_INLINE void clear() noexcept(_NoExceptDestructor)
#define SWC_LOG_OUT(pr, _code_)
Range::Ptr left_sibling(const Range::Ptr &right)
SWC_CAN_INLINE State state()
static SWC_CAN_INLINE FS::Interface::Ptr & interface() noexcept
static bool remove(int &err, const cid_t cid)
std::shared_ptr< Range > Ptr
void change_rgr(rgrid_t rgrid_old, rgrid_t rgrid)
SWC_CAN_INLINE void state(int &err)
SWC_CAN_INLINE Column(const DB::Schema::Ptr &schema)
constexpr SWC_CAN_INLINE void store(T v) noexcept
static const std::string get_path(const cid_t cid)
constexpr SWC_CAN_INLINE bool empty() const noexcept
void remove_rgr_schema(const rgrid_t rgrid)
void remove_range(rid_t rid)
The SWC-DB C++ namespace 'SWC'.
Range::Ptr get_range(const rid_t rid)
void print(std::ostream &out)
SWC_CAN_INLINE void _set_loading()
Range::Ptr get_range(int &, const DB::Cell::Key &range_begin, const DB::Cell::Key &range_end, bool next_range)
void _print(std::ostream &out)
void set_unloaded(const Range::Ptr &range)
rid_t SWC_PURE_FUNC _get_next_rid() const noexcept
constexpr SWC_CAN_INLINE T exchange(T value) noexcept
Range::Ptr get_next_unassigned()
void assigned(rgrid_t rgrid, size_t &num, Core::Vector< Range::Ptr > &_ranges)
constexpr SWC_CAN_INLINE const_iterator cend() const noexcept
std::unordered_map< rgrid_t, int64_t > m_schemas_rev
void need_health_check(int64_t ts, uint32_t ms, Core::Vector< Range::Ptr > &_ranges, rgrid_t rgrid=0, size_t max=0)
Core::Atomic< State > m_state
void get_ranges(Core::Vector< Range::Ptr > &_ranges)
SWC_CAN_INLINE int64_t now_ms() noexcept
SWC_CAN_INLINE State _state()
void set_rgr_unassigned(rgrid_t rgrid)
void need_schema_sync(int64_t rev, Core::Vector< rgrid_t > &rgrids)
bool need_schema_sync(const rgrid_t rgrid, int64_t rev)
std::shared_ptr< Column > Ptr
static bool create(int &err, const cid_t cid)
void _remove_rgr_schema(const rgrid_t rgrid)
SWC_CAN_INLINE void assign(IteratorT first, IteratorT last)
SWC_CAN_INLINE void push_back(ArgsT &&... args)
constexpr SWC_CAN_INLINE const_iterator cbegin() const noexcept
void change_rgr_schema(const rgrid_t rgrid, int64_t rev=0)
constexpr SWC_CAN_INLINE size_type size() const noexcept
void sort(Range::Ptr &range, const DB::Cells::Interval &interval, int64_t revision)
SWC_CAN_INLINE reference emplace_back(ArgsT &&... args)
void assigned(Core::Vector< rgrid_t > &rgrids)
SWC_CAN_INLINE iterator insert(size_type offset, ArgsT &&... args)
bool set_merging(const Range::Ptr &range)
void reset_health_check()