SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Ranger::CellStore::Readers Class Referencefinal

#include <swcdb/ranger/db/CellStoreReaders.h>

+ Inheritance diagram for SWC::Ranger::CellStore::Readers:
+ Collaboration diagram for SWC::Ranger::CellStore::Readers:

Public Types

typedef Core::Vector< Read::PtrVec
 
typedef ReadersPtr
 

Public Member Functions

 Readers () noexcept
 
 Readers (const Readers &)=delete
 
 Readers (const Readers &&)=delete
 
Readersoperator= (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
 

Private Member Functions

void _free ()
 
void _close ()
 
- Private Member Functions inherited from SWC::Core::Vector< Read::Ptr >
constexpr SWC_CAN_INLINE Vector () noexcept
 
SWC_CAN_INLINE Vector (size_type sz, ArgsT &&... args)
 
constexpr SWC_CAN_INLINE Vector (Vector &&other) noexcept
 
SWC_CAN_INLINE Vector (const Vector &other)
 
SWC_CAN_INLINE Vector (const_iterator _b, const_iterator _e)
 
SWC_CAN_INLINE Vector (std::initializer_list< value_type > &&l)
 
SWC_CAN_INLINE ~Vector () noexcept(_NoExceptDestructor)
 
SWC_CAN_INLINE void clear () noexcept(_NoExceptDestructor)
 
SWC_CAN_INLINE void free () noexcept
 
SWC_CAN_INLINE Vectoroperator= (Vector &&other) noexcept
 
SWC_CAN_INLINE Vectoroperator= (const Vector &other)
 
SWC_CAN_INLINE void swap (Vector &other) noexcept
 
constexpr SWC_CAN_INLINE bool empty () const noexcept
 
constexpr SWC_CAN_INLINE bool operator== (const Vector &other) const noexcept
 
constexpr SWC_CAN_INLINE bool operator!= (const Vector &other) const noexcept
 
constexpr SWC_CAN_INLINE size_type size () const noexcept
 
constexpr SWC_CAN_INLINE size_type capacity () const noexcept
 
constexpr SWC_CAN_INLINE pointer data () noexcept
 
constexpr SWC_CAN_INLINE const_pointer data () const noexcept
 
constexpr SWC_CAN_INLINE iterator begin () noexcept
 
constexpr SWC_CAN_INLINE const_iterator begin () const noexcept
 
constexpr SWC_CAN_INLINE const_iterator cbegin () const noexcept
 
constexpr SWC_CAN_INLINE iterator end () noexcept
 
constexpr SWC_CAN_INLINE const_iterator end () const noexcept
 
constexpr SWC_CAN_INLINE const_iterator cend () const noexcept
 
constexpr SWC_CAN_INLINE reference front () noexcept
 
constexpr SWC_CAN_INLINE const_reference front () const noexcept
 
constexpr SWC_CAN_INLINE reference back () noexcept
 
constexpr SWC_CAN_INLINE const_reference back () const noexcept
 
constexpr SWC_CAN_INLINE reference operator[] (size_type pos) noexcept
 
constexpr SWC_CAN_INLINE const_reference operator[] (size_type pos) const noexcept
 
SWC_CAN_INLINE void shrink_to_fit (size_type sz=0)
 
SWC_CAN_INLINE void reserve (size_type cap)
 
SWC_CAN_INLINE void reserve ()
 
SWC_CAN_INLINE void resize (size_type sz, ArgsT &&... args)
 
SWC_CAN_INLINE void push_back (ArgsT &&... args)
 
SWC_CAN_INLINE void push_back_unsafe (ArgsT &&... args) noexcept(std::is_nothrow_constructible_v< value_type, ArgsT... >)
 
SWC_CAN_INLINE reference emplace_back (ArgsT &&... args)
 
SWC_CAN_INLINE reference emplace_back_unsafe (ArgsT &&... args) noexcept(std::is_nothrow_constructible_v< value_type, ArgsT... >)
 
SWC_CAN_INLINE iterator insert (size_type offset, ArgsT &&... args)
 
SWC_CAN_INLINE iterator insert (const_iterator it, ArgsT &&... args)
 
SWC_CAN_INLINE iterator insert (size_type offset, const_iterator first, const_iterator last)
 
SWC_CAN_INLINE iterator insert (const_iterator it, const_iterator first, const_iterator last)
 
SWC_CAN_INLINE reference emplace (const_iterator it, ArgsT &&... args)
 
SWC_CAN_INLINE iterator insert_unsafe (const_iterator it, ArgsT &&... args) noexcept(_NoExceptMove &&_NoExceptDestructor &&std::is_nothrow_constructible_v< value_type, ArgsT... >)
 
SWC_CAN_INLINE void assign (IteratorT first, IteratorT last)
 
SWC_CAN_INLINE iterator erase (size_type offset) noexcept(_NoExceptMoveAssign &&_NoExceptDestructor)
 
SWC_CAN_INLINE iterator erase (const_iterator it) noexcept(_NoExceptMoveAssign &&_NoExceptDestructor)
 
SWC_CAN_INLINE iterator erase (const_iterator first, const_iterator last) noexcept(_NoExceptMoveAssign &&_NoExceptDestructor)
 
SWC_CAN_INLINE void pop_back () noexcept(_NoExceptDestructor)
 

Additional Inherited Members

- Private Types inherited from SWC::Core::Vector< Read::Ptr >
using value_type = Read::Ptr
 
using size_type = uint32_t
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typeiterator
 
typedef const value_typeconst_iterator
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
- Static Private Member Functions inherited from SWC::Core::Vector< Read::Ptr >
constexpr static SWC_CAN_INLINE size_type max_size () noexcept
 

Detailed Description

Definition at line 15 of file CellStoreReaders.h.

Member Typedef Documentation

◆ Ptr

Definition at line 19 of file CellStoreReaders.h.

◆ Vec

Constructor & Destructor Documentation

◆ Readers() [1/3]

SWC::Ranger::CellStore::Readers::Readers ( )
inlineexplicitnoexcept

Definition at line 34 of file CellStoreReaders.h.

◆ Readers() [2/3]

SWC::Ranger::CellStore::Readers::Readers ( const Readers )
delete

◆ Readers() [3/3]

SWC::Ranger::CellStore::Readers::Readers ( const Readers &&  )
delete

◆ ~Readers()

SWC::Ranger::CellStore::Readers::~Readers ( )
inlinenoexcept

Definition at line 46 of file CellStoreReaders.h.

Member Function Documentation

◆ _close()

void SWC::Ranger::CellStore::Readers::_close ( )
private

Definition at line 333 of file CellStoreReaders.cc.

References SWC::Error::OK.

Referenced by clear(), decode(), load_from_path(), remove(), replace(), and unload().

+ Here is the caller graph for this function:

◆ _free()

void SWC::Ranger::CellStore::Readers::_free ( )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add()

void SWC::Ranger::CellStore::Readers::add ( Read::Ptr  cs)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blocks_count()

SWC_CAN_INLINE size_t SWC::Ranger::CellStore::Readers::blocks_count ( ) const

Definition at line 55 of file CellStoreReaders.cc.

Referenced by get_blocks().

+ Here is the caller graph for this function:

◆ clear()

void SWC::Ranger::CellStore::Readers::clear ( )

Definition at line 94 of file CellStoreReaders.cc.

References _close(), and _free().

Referenced by SWC::Ranger::RangeData::read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decode()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ encode()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ encoded_length()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expand_and_align()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_blocks()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_cell_revs()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_key_end()

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().

+ Here is the call graph for this function:

◆ get_prev_key_end()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_ts_earliest()

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.

◆ init()

void SWC::Ranger::CellStore::Readers::init ( const RangePtr for_range)
inline

Definition at line 42 of file CellStoreReaders.h.

References range.

Referenced by SWC::Ranger::Blocks::init().

+ Here is the caller graph for this function:

◆ load()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_cells()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_from_path()

SWC_CAN_INLINE void SWC::Ranger::CellStore::Readers::load_from_path ( int &  err)

◆ move_from()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ need_compaction()

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().

+ Here is the call graph for this function:

◆ operator=()

Readers& SWC::Ranger::CellStore::Readers::operator= ( const Readers )
delete

◆ print()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processing()

bool SWC::Ranger::CellStore::Readers::processing ( ) const
noexcept

Definition at line 73 of file CellStoreReaders.cc.

Referenced by print(), and SWC::Ranger::Blocks::wait_processing().

+ Here is the caller graph for this function:

◆ release()

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().

+ Here is the caller graph for this function:

◆ remove()

void SWC::Ranger::CellStore::Readers::remove ( int &  err)

Definition at line 80 of file CellStoreReaders.cc.

References _close(), _free(), and range.

+ Here is the call graph for this function:

◆ replace()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size_bytes()

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().

+ Here is the caller graph for this function:

◆ unload()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ range

RangePtr SWC::Ranger::CellStore::Readers::range

The documentation for this class was generated from the following files: