 |
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.
10 namespace SWC {
namespace Ranger {
17 return it == cend() ? nullptr : it->second;
27 return err ? nullptr : col->get_range(rid);
33 auto it = find(last_cid);
36 last_cid = it->second->cfg->cid;
46 for(
size_t i=idx; i; --i, ++it);
47 last_cid = it->second->cfg->cid;
58 for(
auto it = cbegin(); it != cend(); ++it)
65 for(
auto it = cbegin(); it != cend(); ++it)
81 auto res = emplace(req->cid,
nullptr);
83 res.first->second.reset(
new Column(req->cid, schema));
84 }
else if(!res.first->second->ranges_count()) {
85 if(res.first->second->cfg->use_count() > 1)
89 req->cid,
size_t(res.first->second->cfg->use_count()));
90 res.first->second.reset(
new Column(req->cid, schema));
92 res.first->second->cfg->update(schema);
94 col = res.first->second;
118 for(
auto it = cbegin(); it != cend(); ++it) {
119 if((!cid_begin || cid_begin <= it->first) &&
120 (!cid_end || cid_end >= it->first)) {
121 req->add(it->second);
123 return ++it != cend();
162 if(it != cend() && it->second->is_not_used()) {
190 bytes, level, released);
193 for(
size_t offset = 0; ; ++offset) {
196 if(col && (it = find(col->cfg->cid)) != cend()) {
200 for(
size_t i=0; i < offset && it != cend(); ++it, ++i);
202 if(level == 2 || level == 4) {
203 for(; it != cend() &&
211 released += col->release(bytes - released, level);
212 if(released >= bytes)
215 }
while(released < bytes && ++level < 5);
224 for(
auto it = cbegin(); it != cend(); ++it){
225 it->second->print(out, minimal);
static SWC_CAN_INLINE System::Resources & res() noexcept
constexpr SWC_CAN_INLINE void stop() noexcept
RangePtr get_range(int &err, const cid_t cid, const rid_t rid)
SWC_CAN_INLINE uint32_t concurrency() const noexcept
std::shared_ptr< ColumnsUnload > Ptr
void internal_delete(cid_t cid)
#define SWC_LOGF(priority, fmt,...)
constexpr SWC_CAN_INLINE bool is_data(cid_t cid) noexcept
void print(std::ostream &out, bool minimal=true)
ColumnPtr get_column(const cid_t cid)
void get_cids(cids_t &cids)
std::shared_ptr< Column > ColumnPtr
void load_range(const DB::SchemaPrimitives &schema, const Callback::RangeLoad::Ptr &req)
void erase_if_empty(cid_t cid)
std::shared_ptr< Range > RangePtr
Core::StateRunning m_release
ColumnPtr get_next(cid_t &last_cid, size_t &idx)
The SWC-DB C++ namespace 'SWC'.
constexpr SWC_CAN_INLINE bool running() noexcept
std::shared_ptr< ManageBase > Ptr
const cid_t CID_META_BEGIN
bool unload(cid_t cid_begin, cid_t cid_end, Callback::ColumnsUnload::Ptr req)
static SWC_CAN_INLINE bool is_shuttingdown() noexcept
void unload_all(bool validation)
std::shared_ptr< RangeLoad > Ptr
static SWC_CAN_INLINE bool is_not_accepting() noexcept
std::shared_ptr< ColumnsUnloadAll > Ptr
void get_columns(Core::Vector< ColumnPtr > &columns)
SWC_CAN_INLINE void push_back(ArgsT &&... args)
size_t release(size_t bytes=0)
SWC_CAN_INLINE void reserve(size_type cap)