SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
RangeBlocks.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 namespace SWC { namespace Ranger {
10 
11 
14  : range(nullptr), commitlog(key_seq), cellstores(),
15  m_mutex(),
16  m_block(nullptr), m_blocks_idx(), m_processing(0) {
17 }
18 
20 void Blocks::init(const RangePtr& for_range) {
21  range = for_range;
24 }
25 
28  return this;
29 }
30 
33 
35  for(Block::Ptr blk=m_block; blk; blk=blk->next)
36  blk->schema_update();
37 }
38 
42 }
43 
47 }
48 
50 void Blocks::load(int& err) {
51  commitlog.load(err);
52  cellstores.load(err);
53 }
54 
60 
61  commitlog.unload();
63  _clear();
64  range = nullptr;
66 }
67 
68 void Blocks::remove(int&) {
72 
73  // Unload is enough, Range remove the range-path at once
74  commitlog.remove();
76 
77  _clear();
78  range = nullptr;
80 }
81 
84  cellstores.expand(intval);
85  commitlog.expand(intval);
86 }
87 
92 }
93 
94 void Blocks::apply_new(int &err,
95  CellStore::Writers& w_cellstores,
96  CommitLog::Fragments::Vec& fragments_old) {
99 
100  cellstores.replace(err, w_cellstores);
101  if(err)
102  return;
103  #ifdef SWC_RANGER_WITH_RANGEDATA
105  #endif
106 
107  commitlog.remove(err, fragments_old);
108 }
109 
112 
113  commitlog.add(cell);
114 
115  Block::Ptr blk;
116  {
118  blk = m_block ? *(m_blocks_idx.cbegin() + _narrow(cell.key)) : nullptr;
119  }
120  while(blk && !blk->add_logged(cell)) {
122  blk = blk->next;
123  }
124 }
125 
127  if(!blk_ptr)
129 
130  if(req->expired()) {
132  return;
133  }
134 
135  bool support;
136  int err = Error::OK;
137  range->state(err);
138  if(!err) {
139  support = m_mutex.lock();
140  if(!m_block)
141  init_blocks(err);
142  m_mutex.unlock(support);
143  }
144 
145  if(err) {
147  req->response(err);
148  return;
149  }
150 
151  for(Block::Ptr blk = nullptr; ; blk = nullptr) {
152  int64_t ts = Time::now_ns();
153 
154  if(req->with_block() && req->block) {
155  (blk = blk_ptr = static_cast<Block*>(req->block))
156  ->processing_increment();
157  req->block = nullptr;
158 
159  } else {
160  if(blk_ptr) {
162  blk_ptr->release();
163  support = m_mutex.lock();
164  blk_ptr = blk_ptr->next;
165 
166  } else {
167  support = m_mutex.lock();
168  blk_ptr = (*(m_blocks_idx.cbegin() +
169  _narrow(
170  req->spec.offset_key.empty()
171  ? req->spec.range_begin
172  : req->spec.offset_key
173  )
174  ));
175  }
176  m_mutex.unlock(support);
177 
178  while(blk_ptr && !blk_ptr->is_next(req->spec)) {
179  support = m_mutex.lock();
180  blk_ptr = blk_ptr->next;
181  m_mutex.unlock(support);
182  }
183 
184  if(blk_ptr)
185  (blk = blk_ptr)->processing_increment();
186  }
187 
188  req->profile.add_block_locate(ts);
189  if(!blk)
190  break;
191 
192  switch(blk->scan(req)) {
193 
194  case Block::ScanState::RESPONDED:
195  return;
196 
199  Block::Ptr prev = blk;
200  for(size_t n=0;
201  n < req->readahead &&
203  && m_mutex.try_full_lock(support); ++n) {
204  blk = blk->next;
205  m_mutex.unlock(support);
206  if(!blk || commitlog.is_compacting())
207  break;
208  if(blk->need_load() && blk->includes(req->spec)) {
209  blk->processing_increment();
210  blk->preload();
211  }
212  }
213  if(!req->with_block()) {
214  size_t need = Env::Rgr::scan_reserved_bytes() * (req->readahead+1);
215  if(Env::Rgr::res().need_ram(need)) {
216  for(size_t sz; ; need -= sz) {
217  support = m_mutex.lock();
218  prev = prev->prev;
219  m_mutex.unlock(support);
220  if(!prev || (sz = prev->release()) > need)
221  break;
222  }
223  }
224  }
226  return;
227  }
228 
229  default:
230  break;
231  }
232 
233  }
234 
236 
237  req->response(err);
238 }
239 
240 
241 bool Blocks::_split(Block::Ptr blk, bool loaded) {
242  // call is under blk lock
243  bool support;
244  if(blk->_need_split() && m_mutex.try_full_lock(support)) {
245  bool preload = false;
246  bool had = false;
247  auto offset = _get_block_idx(blk);
248  do {
249  blk = blk->_split(loaded);
250  if(!blk) {
251  m_mutex.unlock(support);
252  return had;
253  }
254  m_blocks_idx.insert(m_blocks_idx.cbegin()+(++offset), blk);
255  if(!blk->loaded()) {
256  if((preload = !commitlog.is_compacting() &&
257  range->is_loaded() && range->compacting() &&
260  blk->processing_increment();
261  break;
262  }
263  had = true;
264  } while(blk->_need_split());
265  m_mutex.unlock(support);
266 
267  if(preload)
268  blk->preload();
269  return true;
270  }
271  return false;
272 }
273 
275  size_t sz = 0;
277  for(Block::Ptr blk=m_block; blk; blk=blk->next)
278  sz += blk->size();
279  return sz;
280 }
281 
282 size_t Blocks::size() noexcept {
284  return _size();
285 }
286 
289  return _size_bytes();
290 }
291 
292 size_t Blocks::size_bytes_total(bool only_loaded) {
294  return _size_bytes()
295  + cellstores.size_bytes(only_loaded)
296  + commitlog.size_bytes(only_loaded);
297 }
298 
299 size_t Blocks::release(size_t bytes) {
300  size_t released;
301  if((released = release(bytes, 0)) < bytes &&
302  (released += release(bytes, 1)) < bytes &&
304  released += release(bytes, 2);
305  /* with new fragments commit
306  if(!DB::Types::SystemColumn::is_data(range->cfg->cid) ||
307  (released += release(bytes, 2)) < bytes)
308  released += release(bytes, 3);
309  */
310  }
311  return released;
312 }
313 
314 size_t Blocks::release(size_t bytes, uint8_t level) {
316  size_t released = 0;
317 
318  if(!range->compact_apply()) switch(level) {
319  case 0: {
320  released = cellstores.release(bytes);
321  break;
322  }
323  case 1: {
324  released = commitlog.release(bytes);
325  break;
326  }
327  case 2: {
328  bool support;
329  if(m_mutex.try_full_lock(support)) {
330  for(Block::Ptr blk=m_block; blk; blk=blk->next) {
331  released += blk->release();
332  if(released >= bytes)
333  break;
334  }
335  m_mutex.unlock(support);
336  }
337  break;
338  }
339  case 3: {
340  released = commitlog.commit_release();
341  break;
342  }
343  case 4: {
344  bool support;
345  if(m_mutex.try_full_lock(support)) {
346  if(m_block) {
347  if(m_processing.fetch_add(1) == 1 && !range->compacting()) {
348  for(Block::Ptr blk = m_block; blk; blk = blk->next) {
349  released += blk->_releasing_size();
350  }
351  _clear();
352  }
354  }
355  m_mutex.unlock(support);
356  }
357  break;
358  }
359  default:
360  break;
361  }
363  return released;
364 }
365 
368  _clear();
369 }
370 
371 bool Blocks::processing() noexcept {
372  bool support;
373  bool busy;
374  if(!(busy = !m_mutex.try_full_lock(support))) {
375  busy = _processing();
376  m_mutex.unlock(support);
377  }
378  return busy;
379 }
380 
381 bool Blocks::wait_processing(int64_t quit_time) {
382  do {
384  if(quit_time && quit_time < Time::now_ns()) {
387  "Blocks wait-processing quit " SWC_FMT_LU "/" SWC_FMT_LU
388  " blocks=%d commitlog=%d cellstores=%d",
389  range->cfg->cid, range->rid,
391  );
392  range->print(SWC_LOG_OSTREAM << '\n', false);
393  );
394  return false;
395  }
396  std::this_thread::sleep_for(std::chrono::microseconds(50));
397  }
398  std::this_thread::yield();
399  } while(processing() || commitlog.processing() || cellstores.processing());
400  return true;
401 }
402 
403 void Blocks::print(std::ostream& out, bool minimal) {
405  out << "Blocks(count=" << _size();
406  if(minimal) {
407  if(m_block) {
408  Block::Ptr blk = m_block;
409  blk->print(out << " first=");
410  for(; blk->next; blk=blk->next);
411  if(blk != m_block) {
412  blk->print(out << " last=");
413  }
414  }
415  } else {
416  out << " blocks=[";
417  for(Block::Ptr blk = m_block; blk; blk=blk->next) {
418  blk->print(out);
419  out << ", ";
420  }
421  out << ']';
422  }
423  commitlog.print(out << ' ', minimal);
424  cellstores.print(out << ' ', minimal);
425  out
426  << " processing=" << _processing()
427  << " bytes=" << _size_bytes()
428  << ')';
429 }
430 
432 size_t Blocks::_size() const noexcept {
433  size_t sz = 0;
434  for(Block::Ptr blk=m_block; blk; blk=blk->next)
435  ++sz;
436  return sz;
437 }
438 
441  size_t sz = 0;
442  for(Block::Ptr blk=m_block; blk; blk=blk->next)
443  sz += blk->size_bytes();
444  return sz;
445 }
446 
448 bool Blocks::_processing() const noexcept {
449  if(m_processing)
450  return true;
451  for(Block::Ptr blk=m_block; blk; blk=blk->next) {
452  if(blk->processing())
453  return true;
454  }
455  return false;
456 }
457 
459  m_blocks_idx.clear();
460  Block::Ptr blk = m_block;
461  for(; blk; blk=blk->next) {
462  delete blk->prev;
463  if(!blk->next) {
464  delete blk;
465  break;
466  }
467  }
468  m_block = nullptr;
469 }
470 
471 void Blocks::init_blocks(int& err) {
473  cellstores.get_blocks(err, blocks);
474  if(err) {
475  _clear();
476  return;
477  }
478 
479  Block::Ptr blk = nullptr;
480  m_blocks_idx.reserve(blocks.size());
481  for(auto cs_blk : blocks) {
482  if(!blk) {
483  m_block = blk = Block::make(cs_blk->header.interval, ptr());
484  m_block->_set_prev_key_end(range->prev_range_end);
485  m_blocks_idx.push_back(blk);
486  } else if(blk->_cond_key_end(cs_blk->header.interval.key_begin)
487  != Condition::EQ) {
488  blk->_add(Block::make(cs_blk->header.interval, ptr()));
489  blk->next->_set_prev_key_end(blk);
490  m_blocks_idx.push_back((blk = blk->next));
491  } else {
492  blk->_set_key_end(cs_blk->header.interval.key_end);
493  }
494  }
495  if(!m_block) {
497  return;
498  }
499 
500  if(range->_is_any_end())
501  blk->_free_key_end();
502 }
503 
505 size_t Blocks::_get_block_idx(Block::Ptr blk) const noexcept {
506  for(auto it=m_blocks_idx.cbegin(); it != m_blocks_idx.cend();++it)
507  if(*it == blk)
508  return it - m_blocks_idx.cbegin();
509  return 0; // eq m_block;
510 }
511 
513 size_t Blocks::_narrow(const DB::Cell::Key& key) const {
514  size_t offset = 0;
515  if(key.empty() || m_blocks_idx.size() <= MAX_IDX_NARROW)
516  return offset;
517 
518  size_t step = offset = m_blocks_idx.size() >> 1;
519  try_narrow:
520  if(!(*(m_blocks_idx.cbegin() + offset))->is_in_end(key)) {
521  if(step < MAX_IDX_NARROW)
522  return offset;
523  offset += step >>= 1;
524  goto try_narrow;
525  }
526  if((step >>= 1) <= MAX_IDX_NARROW)
527  ++step;
528  if(offset < step)
529  return 0;
530  offset -= step;
531  goto try_narrow;
532 }
533 
534 
535 }}
SWC::Ranger::RangeData::save
void save(int &err, CellStore::Readers &cellstores)
Definition: RangeData.cc:40
SWC::Env::Rgr::res
static SWC_CAN_INLINE System::Resources & res() noexcept
Definition: RangerEnv.h:131
SWC::Error::RGR_NOT_LOADED_RANGE
@ RGR_NOT_LOADED_RANGE
Definition: Error.h:91
SWC_LOG_OSTREAM
#define SWC_LOG_OSTREAM
Definition: Logger.h:44
SWC::Ranger::Block::is_next
bool is_next(const DB::Specs::Interval &spec) const
Definition: RangeBlock.cc:119
SWC::Ranger::CellStore::Readers::expand
void expand(DB::Cells::Interval &intval) const
Definition: CellStoreReaders.cc:21
SWC::Ranger::Block::make
static Ptr make(const DB::Cells::Interval &interval, Blocks *blocks, State state=State::NONE)
Definition: RangeBlock.cc:16
SWC::Ranger::Block
Definition: RangeBlock.h:23
SWC_LOG_OUT
#define SWC_LOG_OUT(pr, _code_)
Definition: Logger.h:178
SWC::Time::now_ns
SWC_CAN_INLINE int64_t now_ns() noexcept
Definition: Time.h:43
SWC::Ranger::CommitLog::Fragments::unload
void unload()
Definition: CommitLog.cc:427
SWC::Ranger::Block::next
Block::Ptr next
Definition: RangeBlock.h:42
SWC_LOG_PRINTF
#define SWC_LOG_PRINTF(fmt,...)
Definition: Logger.h:165
SWC::DB::Types::SystemColumn::is_data
constexpr SWC_CAN_INLINE bool is_data(cid_t cid) noexcept
Definition: SystemColumn.h:46
SWC::Ranger::Blocks::expand_and_align
void expand_and_align(DB::Cells::Interval &intval)
Definition: RangeBlocks.cc:89
SWC::Ranger::Blocks::remove
void remove(int &err)
Definition: RangeBlocks.cc:68
SWC::Ranger::Block::processing_increment
void processing_increment() noexcept
Definition: RangeBlock.cc:422
SWC::Ranger::Block::add_logged
bool add_logged(const DB::Cells::Cell &cell)
Definition: RangeBlock.cc:168
SWC::Ranger::Blocks::MAX_IDX_NARROW
static const uint8_t MAX_IDX_NARROW
Definition: RangeBlocks.h:109
SWC::Core::MutexSptd::scope
Definition: MutexSptd.h:96
SWC::Ranger::CellStore::Readers::init
void init(const RangePtr &for_range)
Definition: CellStoreReaders.h:42
SWC::Ranger::CommitLog::Fragments::print
void print(std::ostream &out, bool minimal)
Definition: CommitLog.cc:566
SWC::DB::Cells::Cell
Definition: Cell.h:92
SWC::Ranger::CommitLog::Fragments::processing
bool processing() noexcept
Definition: CommitLog.cc:540
SWC::Core::MutexSptd::unlock
SWC_CAN_INLINE void unlock(const bool &support) noexcept
Definition: MutexSptd.h:71
SWC::Ranger::Blocks::size_bytes_total
size_t size_bytes_total(bool only_loaded=false)
Definition: RangeBlocks.cc:292
SWC::Ranger::Blocks::processing_increment
void processing_increment()
Definition: RangeBlocks.cc:40
SWC::DB::Cell::Key
Definition: CellKey.h:24
SWC::Ranger::CellStore::Readers::expand_and_align
void expand_and_align(DB::Cells::Interval &intval) const
Definition: CellStoreReaders.cc:26
SWC::Ranger::Blocks::release
size_t release(size_t bytes)
Definition: RangeBlocks.cc:299
SWC::Ranger::Block::prev
Block::Ptr prev
Definition: RangeBlock.h:43
SWC::DB::Cells::Cell::key
DB::Cell::Key key
Definition: Cell.h:357
SWC::Ranger::Blocks::m_block
Block::Ptr m_block
Definition: RangeBlocks.h:112
SWC::Ranger::Block::_split
Ptr _split(bool loaded)
Definition: RangeBlock.cc:357
SWC::Ranger::Block::_free_key_end
void _free_key_end()
Definition: RangeBlock.cc:91
SWC::Ranger::Blocks::commitlog
CommitLog::Fragments commitlog
Definition: RangeBlocks.h:30
SWC::Ranger::Blocks::size_bytes
size_t size_bytes()
Definition: RangeBlocks.cc:287
SWC::Ranger::CommitLog::Fragments::expand
void expand(DB::Cells::Interval &intval)
Definition: CommitLog.cc:322
SWC::Ranger::Blocks::init
void init(const RangePtr &for_range)
Definition: RangeBlocks.cc:20
SWC::Ranger::CellStore::Readers::size_bytes
size_t size_bytes(bool only_loaded=false) const
Definition: CellStoreReaders.cc:33
SWC::DB::Types::KeySeq
KeySeq
Definition: KeySeq.h:13
SWC::Ranger::Blocks::cells_count
size_t cells_count()
Definition: RangeBlocks.cc:274
SWC::DB::Cell::Key::empty
constexpr SWC_CAN_INLINE bool empty() const noexcept
Definition: CellKey.h:186
SWC::Ranger::Blocks::m_mutex
Core::MutexSptd m_mutex
Definition: RangeBlocks.h:111
SWC::Error::OK
@ OK
Definition: Error.h:45
SWC::Ranger::RangePtr
std::shared_ptr< Range > RangePtr
Definition: Columns.h:15
SWC_CAN_INLINE
#define SWC_CAN_INLINE
Definition: Compat.h:102
SWC::Ranger::Blocks::processing_decrement
void processing_decrement()
Definition: RangeBlocks.cc:45
SWC::Ranger::Block::release
size_t release()
Definition: RangeBlock.cc:401
SWC::Ranger::Block::_cond_key_end
Condition::Comp _cond_key_end(const DB::Cell::Key &key) const
Definition: RangeBlock.cc:81
SWC::Ranger::Block::preload
void preload()
Definition: RangeBlock.cc:150
SWC::Ranger::Blocks::_size_bytes
size_t _size_bytes()
Definition: RangeBlocks.cc:440
SWC::Ranger::Blocks::wait_processing
bool wait_processing(int64_t quit_time=0)
Definition: RangeBlocks.cc:381
SWC::Ranger::CellStore::Readers::load
void load(int &err)
Definition: CellStoreReaders.cc:14
SWC::Ranger::CommitLog::Fragments::load
void load(int &err)
Definition: CommitLog.cc:297
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Ranger::CommitLog::Fragments::commit_finalize
void commit_finalize()
Definition: CommitLog.cc:90
SWC::Ranger::Blocks::_split
bool _split(Block::Ptr blk, bool loaded)
Definition: RangeBlocks.cc:241
SWC::Ranger::CellStore::Readers::print
void print(std::ostream &out, bool minimal=true) const
Definition: CellStoreReaders.cc:312
SWC::Ranger::CommitLog::Fragments::size_bytes
size_t size_bytes(bool only_loaded=false)
Definition: CommitLog.cc:528
SWC::Core::MutexSptd::lock
SWC_CAN_INLINE bool lock() noexcept
Definition: MutexSptd.h:39
SWC::Ranger::CellStore::Readers::release
size_t release(size_t bytes)
Definition: CellStoreReaders.cc:63
SWC::Ranger::CommitLog::Fragments::remove
void remove(int &err, Vec &fragments_old)
Definition: CommitLog.cc:380
SWC::Ranger::Blocks::schema_update
void schema_update()
Definition: RangeBlocks.cc:31
SWC::Ranger::Blocks::Blocks
Blocks(const DB::Types::KeySeq key_seq)
Definition: RangeBlocks.cc:13
SWC::System::Resources::need_ram
SWC_CAN_INLINE size_t need_ram() const noexcept
Definition: Resources.h:89
SWC::Condition::EQ
@ EQ
Definition: Comparators.h:32
SWC::Ranger::CellStore::Readers::unload
void unload()
Definition: CellStoreReaders.cc:88
SWC::Ranger::Blocks::reset_blocks
void reset_blocks()
Definition: RangeBlocks.cc:366
SWC::Ranger::Blocks::size
size_t size() noexcept
Definition: RangeBlocks.cc:282
SWC::Ranger::CellStore::Readers::get_blocks
void get_blocks(int &err, Read::Blocks &to) const
Definition: CellStoreReaders.cc:112
SWC::DB::Types::MngrRange::QUEUED
@ QUEUED
Definition: MngrRangeState.h:21
SWC::Ranger::Blocks::scan
void scan(ReqScan::Ptr req, Block::Ptr blk_ptr=nullptr)
Definition: RangeBlocks.cc:126
SWC_FMT_LU
#define SWC_FMT_LU
Definition: Compat.h:98
SWC::Ranger::Block::loaded
bool loaded() const noexcept
Definition: RangeBlock.cc:432
SWC::Ranger::CellStore::Readers::replace
void replace(int &err, Writers &w_cellstores)
Definition: CellStoreReaders.cc:224
SWC::Ranger::Blocks::apply_new
void apply_new(int &err, CellStore::Writers &w_cellstores, CommitLog::Fragments::Vec &fragments_old)
Definition: RangeBlocks.cc:94
RangeBlocks.h
SWC::Ranger::Blocks::cellstores
CellStore::Readers cellstores
Definition: RangeBlocks.h:31
SWC::Core::Vector< Write::Ptr >
SWC::Ranger::Block::print
void print(std::ostream &out)
Definition: RangeBlock.cc:494
SWC::Ranger::Blocks::processing
bool processing() noexcept
Definition: RangeBlocks.cc:371
SWC::Ranger::CommitLog::Fragments::schema_update
void schema_update()
Definition: CommitLog.cc:41
SWC::Ranger::CommitLog::Fragments::add
void add(const DB::Cells::Cell &cell)
Definition: CommitLog.cc:54
SWC::Ranger::Blocks::unload
void unload()
Definition: RangeBlocks.cc:55
SWC::Ranger::Blocks::m_blocks_idx
Core::Vector< Block::Ptr > m_blocks_idx
Definition: RangeBlocks.h:113
SWC::Ranger::Blocks::expand
void expand(DB::Cells::Interval &intval)
Definition: RangeBlocks.cc:83
SWC::Ranger::Block::_add
void _add(Ptr blk)
Definition: RangeBlock.cc:392
SWC::Ranger::CommitLog::Fragments::expand_and_align
void expand_and_align(DB::Cells::Interval &intval)
Definition: CommitLog.cc:328
SWC::Ranger::Block::_set_key_end
void _set_key_end(const DB::Cell::Key &key)
Definition: RangeBlock.cc:86
SWC::Ranger::Blocks
Definition: RangeBlocks.h:23
SWC::Ranger::CellStore::Readers::processing
bool processing() const noexcept
Definition: CellStoreReaders.cc:73
SWC::Ranger::Blocks::_get_block_idx
size_t SWC_PURE_FUNC _get_block_idx(const Block::Ptr blk) const noexcept
Definition: RangeBlocks.cc:505
SWC::LOG_WARN
@ LOG_WARN
Definition: Logger.h:33
SWC::Env::Rgr::scan_reserved_bytes
static SWC_CAN_INLINE size_t scan_reserved_bytes() noexcept
Definition: RangerEnv.h:83
SWC::Ranger::Blocks::add_logged
void add_logged(const DB::Cells::Cell &cell)
Definition: RangeBlocks.cc:111
SWC::Ranger::Blocks::print
void print(std::ostream &out, bool minimal)
Definition: RangeBlocks.cc:403
SWC::Ranger::Blocks::range
RangePtr range
Definition: RangeBlocks.h:29
SWC::Ranger::Blocks::_clear
void _clear()
Definition: RangeBlocks.cc:458
SWC::Ranger::CommitLog::Fragments::init
void init(const RangePtr &for_range)
Definition: CommitLog.cc:35
SWC::Core::Atomic::fetch_sub
constexpr SWC_CAN_INLINE T fetch_sub(T v) noexcept
Definition: Atomic.h:88
SWC::DB::Cells::Interval
Definition: Interval.h:17
SWC::Ranger::CommitLog::Fragments::is_compacting
bool is_compacting() const
Definition: CommitLog.cc:205
SWC::Ranger::Blocks::m_processing
Core::Atomic< size_t > m_processing
Definition: RangeBlocks.h:114
SWC::Ranger::Blocks::_processing
bool _processing() const noexcept
Definition: RangeBlocks.cc:448
SWC::Core::Atomic::fetch_add
constexpr SWC_CAN_INLINE T fetch_add(T v) noexcept
Definition: Atomic.h:93
SWC::Ranger::Blocks::_narrow
size_t _narrow(const DB::Cell::Key &key) const
Definition: RangeBlocks.cc:513
SWC::Ranger::Blocks::init_blocks
void init_blocks(int &err)
Definition: RangeBlocks.cc:471
SWC::Core::Vector::size
constexpr SWC_CAN_INLINE size_type size() const noexcept
Definition: Vector.h:189
SWC::Core::MutexSptd::try_full_lock
bool try_full_lock(bool &support) noexcept
Definition: MutexSptd.h:55
SWC::Ranger::ReqScan::Ptr
std::shared_ptr< ReqScan > Ptr
Definition: ReqScan.h:30
SWC::Ranger::Blocks::ptr
Ptr ptr()
Definition: RangeBlocks.cc:27
SWC::Ranger::CommitLog::Fragments::release
size_t release(size_t bytes)
Definition: CommitLog.cc:367
SWC::Ranger::Block::_need_split
bool _need_split() const noexcept
Definition: RangeBlock.cc:486
SWC::Ranger::Blocks::_size
size_t SWC_PURE_FUNC _size() const noexcept
Definition: RangeBlocks.cc:432
SWC::Ranger::Blocks::load
void load(int &err)
Definition: RangeBlocks.cc:50
SWC::Ranger::Block::_set_prev_key_end
void _set_prev_key_end(const DB::Cell::Key &key)
Definition: RangeBlock.cc:71
SWC::Ranger::CommitLog::Fragments::commit_release
size_t commit_release()
Definition: CommitLog.cc:82