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::Read Class Referencefinal

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

+ Collaboration diagram for SWC::Ranger::CellStore::Read:

Public Types

typedef ReadPtr
 
typedef Core::Vector< Block::Read::PtrBlocks
 

Public Member Functions

 Read (const csid_t csid, DB::Cell::Key &&prev_key_end, DB::Cell::Key &&key_end, DB::Cells::Interval &&interval, Blocks &&blocks, const uint32_t cell_revs, const FS::SmartFd::Ptr &smartfd) noexcept
 
 Read (const Read &)=delete
 
 Read (const Read &&)=delete
 
Readoperator= (const Read &)=delete
 
 ~Read () noexcept
 
const std::string & filepath () const
 
void load_cells (BlockLoader *loader)
 
void _run_queued ()
 
void get_blocks (int &err, Blocks &to) const
 
size_t release (size_t bytes)
 
void close (int &err)
 
void remove (int &err)
 
bool processing () const noexcept
 
size_t size_bytes (bool only_loaded=false) const
 
size_t size_bytes_enc (bool only_loaded=false) const
 
size_t blocks_count () const
 
void print (std::ostream &out, bool minimal=true) const
 

Static Public Member Functions

static Ptr make (int &err, const csid_t csid, const RangePtr &range, bool chk_base=false)
 
static bool load_trailer (int &err, FS::SmartFd::Ptr &smartfd, uint32_t &cell_revs, uint32_t &blks_idx_count, uint64_t &blks_idx_offset, bool close_after=false, bool chk_base=false)
 
static void load_blocks_index (int &err, FS::SmartFd::Ptr &smartfd, DB::Cell::Key &prev_key_end, DB::Cell::Key &key_end, DB::Cells::Interval &interval, Blocks &blocks, uint32_t &cell_revs, bool chk_base=false)
 

Public Attributes

const csid_t csid
 
const DB::Cell::Key prev_key_end
 
const DB::Cell::Key key_end
 
const DB::Cells::Interval interval
 
const Blocks blocks
 
const uint32_t cell_revs
 
FS::SmartFd::Ptr smartfd
 

Static Public Attributes

static constexpr uint32_t MAX_BLOCKS = UINT32_MAX
 

Private Member Functions

void _release_fd ()
 

Private Attributes

Core::QueueSafeStated< Block::Read::Ptrm_queue
 

Detailed Description

Definition at line 41 of file CellStore.h.

Member Typedef Documentation

◆ Blocks

◆ Ptr

Definition at line 44 of file CellStore.h.

Constructor & Destructor Documentation

◆ Read() [1/3]

SWC_CAN_INLINE SWC::Ranger::CellStore::Read::Read ( const csid_t  csid,
DB::Cell::Key &&  prev_key_end,
DB::Cell::Key &&  key_end,
DB::Cells::Interval &&  interval,
Blocks &&  blocks,
const uint32_t  cell_revs,
const FS::SmartFd::Ptr smartfd 
)
explicitnoexcept

Definition at line 255 of file CellStore.cc.

Referenced by make().

+ Here is the caller graph for this function:

◆ Read() [2/3]

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

◆ Read() [3/3]

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

◆ ~Read()

SWC::Ranger::CellStore::Read::~Read ( )
noexcept

Definition at line 274 of file CellStore.cc.

References blocks.

Member Function Documentation

◆ _release_fd()

void SWC::Ranger::CellStore::Read::_release_fd ( )
private

Definition at line 335 of file CellStore.cc.

References close(), SWC::Env::FsInterface::interface(), SWC::Error::OK, processing(), and smartfd.

Referenced by _run_queued(), and release().

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

◆ _run_queued()

SWC_CAN_INLINE void SWC::Ranger::CellStore::Read::_run_queued ( )

Definition at line 311 of file CellStore.cc.

References _release_fd(), SWC::Ranger::CellStore::Block::Read::load(), and m_queue.

Referenced by SWC::Ranger::CellStore::Block::Read::load_finish().

+ 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::Read::blocks_count ( ) const

Definition at line 386 of file CellStore.cc.

References blocks, and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().

Referenced by print().

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

◆ close()

SWC_CAN_INLINE void SWC::Ranger::CellStore::Read::close ( int &  err)

Definition at line 345 of file CellStore.cc.

References SWC::Env::FsInterface::interface(), SWC::FS::SmartFd::make_ptr(), and smartfd.

Referenced by _release_fd().

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

◆ filepath()

SWC_CAN_INLINE const std::string & SWC::Ranger::CellStore::Read::filepath ( ) const

Definition at line 291 of file CellStore.cc.

References smartfd.

◆ get_blocks()

SWC_CAN_INLINE void SWC::Ranger::CellStore::Read::get_blocks ( int &  err,
Blocks to 
) const

Definition at line 317 of file CellStore.cc.

References blocks, SWC::Core::Vector< T, SizeT, GROW_SZ >::cbegin(), SWC::Core::Vector< T, SizeT, GROW_SZ >::cend(), and SWC::Core::Vector< T, SizeT, GROW_SZ >::insert().

+ Here is the call graph for this function:

◆ load_blocks_index()

SWC_SHOULD_NOT_INLINE void SWC::Ranger::CellStore::Read::load_blocks_index ( int &  err,
FS::SmartFd::Ptr smartfd,
DB::Cell::Key prev_key_end,
DB::Cell::Key key_end,
DB::Cells::Interval interval,
Blocks blocks,
uint32_t &  cell_revs,
bool  chk_base = false 
)
static

Definition at line 118 of file CellStore.cc.

References SWC::DB::Cells::Interval::align(), SWC::Ranger::CellStore::Block::Header::ANY_BEGIN, SWC::Ranger::CellStore::Block::Header::ANY_END, SWC::Core::Buffer< T >::base, blocks, cell_revs, SWC::Core::checksum_i32_chk(), SWC::Error::CHECKSUM_MISMATCH, SWC::Core::Vector< T, SizeT, GROW_SZ >::clear(), SWC::DB::Cell::Key::copy(), SWC::DB::Cell::Key::decode(), SWC::Core::Encoder::decode(), SWC::Serialization::decode_i32(), SWC::Serialization::decode_i8(), SWC::Ranger::CellStore::Block::Header::decode_idx(), SWC::Serialization::decode_vi32(), SWC::DB::Cells::Interval::expand(), SWC::Core::Buffer< T >::free(), SWC::DB::Cell::Key::free(), SWC::Env::FsInterface::fs(), SWC::Error::FS_EOF, SWC::Ranger::CellStore::IDX_BLKS_HEADER_SIZE, SWC::Env::FsInterface::interface(), interval, SWC::Ranger::CellStore::Block::Header::interval, SWC::Ranger::CellStore::Block::Header::is_any, SWC::DB::Cells::Interval::key_begin, SWC::DB::Cells::Interval::key_end, key_end, SWC::DB::Cells::Interval::key_seq, load_trailer(), SWC::LOG_WARN, SWC::Error::OK, prev_key_end, SWC::Error::print(), SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), SWC::Core::Buffer< T >::set(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), smartfd, SWC_LOG_OSTREAM, and SWC_LOG_OUT.

Referenced by make().

+ 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::Read::load_cells ( BlockLoader loader)

Definition at line 296 of file CellStore.cc.

References SWC::Ranger::BlockLoader::add(), SWC::Ranger::BlockLoader::block, blocks, SWC::Ranger::Block::is_consist(), SWC::Ranger::Block::is_in_end(), and m_queue.

+ Here is the call graph for this function:

◆ load_trailer()

SWC_SHOULD_NOT_INLINE bool SWC::Ranger::CellStore::Read::load_trailer ( int &  err,
FS::SmartFd::Ptr smartfd,
uint32_t &  cell_revs,
uint32_t &  blks_idx_count,
uint64_t &  blks_idx_offset,
bool  close_after = false,
bool  chk_base = false 
)
static

Definition at line 51 of file CellStore.cc.

References cell_revs, SWC::Core::checksum_i32_chk(), SWC::Error::CHECKSUM_MISMATCH, SWC::Serialization::decode_i32(), SWC::Serialization::decode_i64(), SWC::Serialization::decode_i8(), SWC::Env::FsInterface::fs(), SWC::Error::FS_EOF, SWC::Error::FS_PATH_NOT_FOUND, SWC::Env::FsInterface::interface(), SWC::Comm::Protocol::FsBroker::Handler::length(), SWC::LOG_WARN, SWC::Error::OK, SWC::Error::print(), smartfd, SWC_LOG_OSTREAM, SWC_LOG_OUT, and SWC::Ranger::CellStore::TRAILER_SIZE.

Referenced by load_blocks_index().

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

◆ make()

Read::Ptr SWC::Ranger::CellStore::Read::make ( int &  err,
const csid_t  csid,
const RangePtr range,
bool  chk_base = false 
)
inlinestatic

Definition at line 13 of file CellStore.cc.

References blocks, cell_revs, SWC::Error::Exception::code(), csid, interval, key_end, load_blocks_index(), SWC::LOG_ERROR, SWC::FS::SmartFd::make_ptr(), prev_key_end, SWC::DB::Cells::Interval::print(), SWC::Error::print(), Read(), SWC::Core::Vector< T, SizeT, GROW_SZ >::shrink_to_fit(), smartfd, SWC_CURRENT_EXCEPTION, SWC_LOG_OSTREAM, and SWC_LOG_OUT.

Referenced by SWC::Ranger::CellStore::create_initial(), SWC::Ranger::CellStore::Readers::decode(), SWC::Ranger::Range::internal_create(), SWC::Ranger::CellStore::Readers::load_from_path(), SWC::Ranger::CellStore::Readers::move_from(), and SWC::Ranger::CellStore::Readers::replace().

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

◆ operator=()

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

◆ print()

void SWC::Ranger::CellStore::Read::print ( std::ostream &  out,
bool  minimal = true 
) const

Definition at line 390 of file CellStore.cc.

References blocks, blocks_count(), csid, interval, key_end, m_queue, prev_key_end, processing(), size_bytes(), smartfd, and SWC::Ranger::CellStore::VERSION.

+ Here is the call graph for this function:

◆ processing()

SWC_CAN_INLINE bool SWC::Ranger::CellStore::Read::processing ( ) const
noexcept

Definition at line 359 of file CellStore.cc.

References blocks, and m_queue.

Referenced by _release_fd(), and print().

+ Here is the caller graph for this function:

◆ release()

SWC_CAN_INLINE size_t SWC::Ranger::CellStore::Read::release ( size_t  bytes)

Definition at line 322 of file CellStore.cc.

References _release_fd(), blocks, and m_queue.

+ Here is the call graph for this function:

◆ remove()

SWC_CAN_INLINE void SWC::Ranger::CellStore::Read::remove ( int &  err)

Definition at line 354 of file CellStore.cc.

References SWC::Env::FsInterface::interface(), and smartfd.

+ Here is the call graph for this function:

◆ size_bytes()

SWC_CAN_INLINE size_t SWC::Ranger::CellStore::Read::size_bytes ( bool  only_loaded = false) const

Definition at line 370 of file CellStore.cc.

References blocks, and size.

Referenced by print().

+ Here is the caller graph for this function:

◆ size_bytes_enc()

SWC_CAN_INLINE size_t SWC::Ranger::CellStore::Read::size_bytes_enc ( bool  only_loaded = false) const

Definition at line 378 of file CellStore.cc.

References blocks, and size.

Member Data Documentation

◆ blocks

const Blocks SWC::Ranger::CellStore::Read::blocks

◆ cell_revs

const uint32_t SWC::Ranger::CellStore::Read::cell_revs

◆ csid

const csid_t SWC::Ranger::CellStore::Read::csid

Definition at line 68 of file CellStore.h.

Referenced by make(), and print().

◆ interval

const DB::Cells::Interval SWC::Ranger::CellStore::Read::interval

Definition at line 71 of file CellStore.h.

Referenced by load_blocks_index(), make(), and print().

◆ key_end

const DB::Cell::Key SWC::Ranger::CellStore::Read::key_end

Definition at line 70 of file CellStore.h.

Referenced by load_blocks_index(), make(), and print().

◆ m_queue

Core::QueueSafeStated<Block::Read::Ptr> SWC::Ranger::CellStore::Read::m_queue
mutableprivate

Definition at line 122 of file CellStore.h.

Referenced by _run_queued(), load_cells(), print(), processing(), and release().

◆ MAX_BLOCKS

constexpr uint32_t SWC::Ranger::CellStore::Read::MAX_BLOCKS = UINT32_MAX
staticconstexpr

Definition at line 47 of file CellStore.h.

Referenced by SWC::Ranger::CompactRange::write_cells().

◆ prev_key_end

const DB::Cell::Key SWC::Ranger::CellStore::Read::prev_key_end

Definition at line 69 of file CellStore.h.

Referenced by load_blocks_index(), make(), and print().

◆ smartfd


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