#include <swcdb/ranger/db/CellStoreReaders.h>
Public Types | |
typedef Core::Vector< Read::Ptr > | Vec |
typedef Readers * | Ptr |
Public Member Functions | |
Readers () noexcept | |
Readers (const Readers &)=delete | |
Readers (const Readers &&)=delete | |
Readers & | operator= (const Readers &)=delete |
void | init (const RangePtr &for_range) |
~Readers () noexcept | |
void | add (Read::Ptr cs) |
void | load (int &err) |
void | expand (DB::Cells::Interval &intval) const |
void | expand_and_align (DB::Cells::Interval &intval) const |
size_t | size_bytes (bool only_loaded=false) const |
uint32_t | get_cell_revs () const |
int64_t SWC_PURE_FUNC | get_ts_earliest () const |
size_t | blocks_count () const |
size_t | release (size_t bytes) |
bool | processing () const noexcept |
void | remove (int &err) |
void | unload () |
void | clear () |
void | load_cells (BlockLoader *loader) |
void | get_blocks (int &err, Read::Blocks &to) const |
void | get_prev_key_end (uint32_t idx, DB::Cell::Key &key) const |
void | get_key_end (DB::Cell::Key &key) const |
bool SWC_PURE_FUNC | need_compaction (size_t cs_max, size_t cs_sz, size_t blk_size) const |
uint32_t SWC_PURE_FUNC | encoded_length () const |
void | encode (uint8_t **ptr) const |
void | decode (int &err, const uint8_t **ptr, size_t *remain) |
void | load_from_path (int &err) |
void | replace (int &err, Writers &w_cellstores) |
void | move_from (int &err, Readers::Vec &mv_css) |
void | print (std::ostream &out, bool minimal=true) const |
Public Attributes | |
RangePtr | range |
Additional Inherited Members | |
Private Types inherited from SWC::Core::Vector< Read::Ptr > | |
using | value_type = Read::Ptr |
using | size_type = uint32_t |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef value_type * | iterator |
typedef const value_type * | const_iterator |
typedef value_type & | reference |
typedef const value_type & | const_reference |
Static Private Member Functions inherited from SWC::Core::Vector< Read::Ptr > | |
constexpr static SWC_CAN_INLINE size_type | max_size () noexcept |
Definition at line 15 of file CellStoreReaders.h.
Definition at line 19 of file CellStoreReaders.h.
Definition at line 18 of file CellStoreReaders.h.
|
inlineexplicitnoexcept |
Definition at line 34 of file CellStoreReaders.h.
|
delete |
|
delete |
|
inlinenoexcept |
Definition at line 46 of file CellStoreReaders.h.
|
private |
Definition at line 333 of file CellStoreReaders.cc.
References SWC::Error::OK.
Referenced by clear(), decode(), load_from_path(), remove(), replace(), and unload().
|
private |
Definition at line 325 of file CellStoreReaders.cc.
References SWC::Core::Vector< Read::Ptr >::clear(), and SWC::Core::Vector< Read::Ptr >::shrink_to_fit().
Referenced by clear(), decode(), load_from_path(), remove(), replace(), and unload().
|
inline |
Definition at line 48 of file CellStoreReaders.h.
References SWC::Core::Vector< Read::Ptr >::push_back().
Referenced by SWC::Ranger::Range::internal_create(), and SWC::Ranger::Range::load().
SWC_CAN_INLINE size_t SWC::Ranger::CellStore::Readers::blocks_count | ( | ) | const |
Definition at line 55 of file CellStoreReaders.cc.
Referenced by get_blocks().
void SWC::Ranger::CellStore::Readers::clear | ( | ) |
Definition at line 94 of file CellStoreReaders.cc.
References _close(), and _free().
Referenced by SWC::Ranger::RangeData::read().
void SWC::Ranger::CellStore::Readers::decode | ( | int & | err, |
const uint8_t ** | ptr, | ||
size_t * | remain | ||
) |
Definition at line 167 of file CellStoreReaders.cc.
References _close(), _free(), SWC::Serialization::decode_vi32(), SWC::Ranger::CellStore::Read::make(), SWC::Core::Vector< Read::Ptr >::push_back(), range, and SWC::Core::Vector< Read::Ptr >::reserve().
Referenced by SWC::Ranger::RangeData::read().
void SWC::Ranger::CellStore::Readers::encode | ( | uint8_t ** | ptr | ) | const |
Definition at line 160 of file CellStoreReaders.cc.
References SWC::Serialization::encode_vi32(), and SWC::Core::Vector< Read::Ptr >::size().
Referenced by SWC::Ranger::RangeData::write().
uint32_t SWC::Ranger::CellStore::Readers::encoded_length | ( | ) | const |
Definition at line 152 of file CellStoreReaders.cc.
References SWC::Serialization::encoded_length_vi32(), and SWC::Core::Vector< Read::Ptr >::size().
Referenced by SWC::Ranger::RangeData::write().
void SWC::Ranger::CellStore::Readers::expand | ( | DB::Cells::Interval & | intval | ) | const |
Definition at line 21 of file CellStoreReaders.cc.
References SWC::DB::Cells::Interval::expand().
Referenced by SWC::Ranger::Blocks::expand().
void SWC::Ranger::CellStore::Readers::expand_and_align | ( | DB::Cells::Interval & | intval | ) | const |
Definition at line 26 of file CellStoreReaders.cc.
References SWC::DB::Cells::Interval::align(), and SWC::DB::Cells::Interval::expand().
Referenced by SWC::Ranger::Blocks::expand_and_align().
SWC_CAN_INLINE void SWC::Ranger::CellStore::Readers::get_blocks | ( | int & | err, |
Read::Blocks & | to | ||
) | const |
Definition at line 112 of file CellStoreReaders.cc.
References blocks_count(), and SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve().
Referenced by SWC::Ranger::Blocks::init_blocks().
SWC_CAN_INLINE uint32_t SWC::Ranger::CellStore::Readers::get_cell_revs | ( | ) | const |
Definition at line 41 of file CellStoreReaders.cc.
References SWC::Core::Vector< Read::Ptr >::front().
Referenced by need_compaction().
SWC_CAN_INLINE void SWC::Ranger::CellStore::Readers::get_key_end | ( | DB::Cell::Key & | key | ) | const |
Definition at line 127 of file CellStoreReaders.cc.
References SWC::Core::Vector< Read::Ptr >::back(), and SWC::DB::Cell::Key::copy().
SWC_CAN_INLINE void SWC::Ranger::CellStore::Readers::get_prev_key_end | ( | uint32_t | idx, |
DB::Cell::Key & | key | ||
) | const |
Definition at line 122 of file CellStoreReaders.cc.
References SWC::Core::Vector< Read::Ptr >::cbegin(), and SWC::DB::Cell::Key::copy().
Referenced by SWC::Ranger::Range::load().
int64_t SWC::Ranger::CellStore::Readers::get_ts_earliest | ( | ) | const |
Definition at line 45 of file CellStoreReaders.cc.
References SWC::Condition::NONE, and SWC::DB::Cells::TIMESTAMP_AUTO.
|
inline |
Definition at line 42 of file CellStoreReaders.h.
References range.
Referenced by SWC::Ranger::Blocks::init().
SWC_CAN_INLINE void SWC::Ranger::CellStore::Readers::load | ( | int & | err | ) |
Definition at line 14 of file CellStoreReaders.cc.
References SWC::Core::Vector< Read::Ptr >::empty(), and SWC::Error::SERIALIZATION_INPUT_OVERRUN.
Referenced by SWC::Ranger::Blocks::load().
SWC_CAN_INLINE void SWC::Ranger::CellStore::Readers::load_cells | ( | BlockLoader * | loader | ) |
Definition at line 100 of file CellStoreReaders.cc.
References SWC::Ranger::BlockLoader::block, SWC::Ranger::Block::is_consist(), and SWC::Ranger::Block::is_in_end().
Referenced by SWC::Ranger::BlockLoader::run().
SWC_CAN_INLINE void SWC::Ranger::CellStore::Readers::load_from_path | ( | int & | err | ) |
Definition at line 180 of file CellStoreReaders.cc.
References _close(), _free(), SWC::Core::Vector< T, SizeT, GROW_SZ >::begin(), SWC::Ranger::Range::CELLSTORES_BAK_DIR, SWC::DB::RangeBase::CELLSTORES_DIR, SWC::Ranger::Range::CELLSTORES_RCVD_DIR, SWC::Core::Vector< T, SizeT, GROW_SZ >::end(), SWC::Env::FsInterface::interface(), SWC::LOG_WARN, SWC::Ranger::CellStore::Read::make(), SWC::Core::Vector< Read::Ptr >::push_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), range, SWC::Core::Vector< Read::Ptr >::reserve(), SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), SWC::Comm::Resolver::sort(), and SWC_LOGF.
Referenced by SWC::Ranger::RangeData::load(), and SWC::Ranger::Range::load().
void SWC::Ranger::CellStore::Readers::move_from | ( | int & | err, |
Readers::Vec & | mv_css | ||
) |
Definition at line 267 of file CellStoreReaders.cc.
References SWC::Env::FsInterface::interface(), SWC::Ranger::CellStore::Read::make(), SWC::Error::OK, SWC::Core::Vector< Read::Ptr >::operator=(), SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), range, SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().
Referenced by SWC::Ranger::Range::internal_create().
bool SWC::Ranger::CellStore::Readers::need_compaction | ( | size_t | cs_max, |
size_t | cs_sz, | ||
size_t | blk_size | ||
) | const |
Definition at line 131 of file CellStoreReaders.cc.
References SWC::Core::Vector< Read::Ptr >::cbegin(), SWC::Core::Vector< Read::Ptr >::cend(), get_cell_revs(), and SWC::Core::Vector< Read::Ptr >::size().
void SWC::Ranger::CellStore::Readers::print | ( | std::ostream & | out, |
bool | minimal = true |
||
) | const |
Definition at line 312 of file CellStoreReaders.cc.
References processing(), SWC::Core::Vector< Read::Ptr >::size(), and size_bytes().
Referenced by SWC::Ranger::Blocks::print().
|
noexcept |
Definition at line 73 of file CellStoreReaders.cc.
Referenced by print(), and SWC::Ranger::Blocks::wait_processing().
SWC_CAN_INLINE size_t SWC::Ranger::CellStore::Readers::release | ( | size_t | bytes | ) |
Definition at line 63 of file CellStoreReaders.cc.
Referenced by SWC::Ranger::Blocks::release().
void SWC::Ranger::CellStore::Readers::remove | ( | int & | err | ) |
Definition at line 80 of file CellStoreReaders.cc.
References _close(), _free(), and range.
void SWC::Ranger::CellStore::Readers::replace | ( | int & | err, |
Writers & | w_cellstores | ||
) |
Definition at line 224 of file CellStoreReaders.cc.
References _close(), _free(), SWC::Ranger::Range::CELLSTORES_BAK_DIR, SWC::DB::RangeBase::CELLSTORES_DIR, SWC::Ranger::Range::CELLSTORES_TMP_DIR, SWC::Env::FsInterface::interface(), SWC::Ranger::CellStore::Read::make(), SWC::Error::OK, SWC::Core::Vector< Read::Ptr >::operator=(), SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), range, SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().
Referenced by SWC::Ranger::Blocks::apply_new().
size_t SWC::Ranger::CellStore::Readers::size_bytes | ( | bool | only_loaded = false | ) | const |
Definition at line 33 of file CellStoreReaders.cc.
Referenced by SWC::Ranger::Range::can_be_merged(), print(), and SWC::Ranger::Blocks::size_bytes_total().
void SWC::Ranger::CellStore::Readers::unload | ( | ) |
Definition at line 88 of file CellStoreReaders.cc.
References _close(), _free(), and range.
Referenced by SWC::Ranger::Blocks::remove(), and SWC::Ranger::Blocks::unload().
RangePtr SWC::Ranger::CellStore::Readers::range |
Definition at line 32 of file CellStoreReaders.h.
Referenced by decode(), init(), SWC::Ranger::RangeData::load(), load_from_path(), move_from(), remove(), replace(), SWC::Ranger::RangeData::save(), and unload().