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::CommitLog::Fragments Class Referencefinal

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

+ Inheritance diagram for SWC::Ranger::CommitLog::Fragments:
+ Collaboration diagram for SWC::Ranger::CommitLog::Fragments:

Public Types

typedef Core::Vector< Fragment::PtrVec
 
typedef FragmentsPtr
 
typedef Core::Vector< VecCompactGroups
 

Public Member Functions

 Fragments (const DB::Types::KeySeq key_seq)
 
void init (const RangePtr &for_range)
 
 Fragments (const Fragments &)=delete
 
 Fragments (const Fragments &&)=delete
 
Fragmentsoperator= (const Fragments &)=delete
 
 ~Fragments () noexcept
 
void schema_update ()
 
SWC_CAN_INLINE int64_t modification_ts () const noexcept
 
void add (const DB::Cells::Cell &cell)
 
SWC_CAN_INLINE std::shared_mutex & cells_mutex () noexcept
 
SWC_CAN_INLINE void _add (const DB::Cells::Cell &cell, size_t *offset_itp, size_t *offsetp)
 
SWC_CAN_INLINE void check_sequence (const char *msg, bool w_assert=true)
 
void commit () noexcept
 
size_t commit_release ()
 
void commit_finalize ()
 
void add (Fragment::Ptr &frag)
 
bool is_compacting () const
 
size_t need_compact (CompactGroups &groups, const Vec &without, size_t vol)
 
bool try_compact (uint32_t tnum=1)
 
void finish_compact (const Compact *compact)
 
std::string get_log_fragment (const int64_t frag) const
 
std::string get_log_fragment (const std::string &frag) const
 
void load (int &err)
 
void expand (DB::Cells::Interval &intval)
 
void expand_and_align (DB::Cells::Interval &intval)
 
void load_cells (BlockLoader *loader, bool &is_final, Vec &frags, uint8_t vol)
 
void get (Vec &fragments)
 
size_t release (size_t bytes)
 
void remove (int &err, Vec &fragments_old)
 
void remove (int &err, Fragment::Ptr &frag, bool remove_file)
 
void remove ()
 
void unload ()
 
Fragment::Ptr take_ownership (int &err, Fragment::Ptr &frag)
 
void take_ownership (int &err, Vec &frags, Vec &removing)
 
bool deleting ()
 
size_t cells_count (bool only_current=false)
 
bool empty ()
 
size_t size () noexcept
 
size_t size_bytes (bool only_loaded=false)
 
size_t size_bytes_encoded ()
 
bool processing () noexcept
 
uint64_t next_id ()
 
void print (std::ostream &out, bool minimal)
 

Public Attributes

RangePtr range
 
Core::AtomicBool stopping
 

Private Member Functions

size_t _commit (bool finalize)
 
void _add (Fragment::Ptr &frag)
 
uint64_t _next_id ()
 
void _remove (int &err, Vec &fragments_old, Core::Semaphore *semp)
 
bool _need_roll () const noexcept
 
size_t _need_compact (CompactGroups &groups, const Vec &without, size_t vol)
 
bool _need_compact_major ()
 
void _load_cells (BlockLoader *loader, Vec &frags, uint8_t &vol)
 
bool _processing () const noexcept
 
size_t _size_bytes (bool only_loaded=false)
 
size_t _narrow (const DB::Cell::Key &key) const
 
- Private Member Functions inherited from SWC::Core::Vector< Fragment::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)
 

Private Attributes

std::shared_mutex m_mutex_cells
 
DB::Cells::MutableVec m_cells
 
Core::StateRunning m_commit
 
Core::AtomicBool m_compacting
 
std::shared_mutex m_mutex
 
bool m_deleting
 
std::condition_variable_any m_cv
 
Core::Semaphore m_sem
 
uint64_t m_last_id
 
Core::Atomic< size_t > m_releasable_bytes
 
Core::Atomic< size_t > m_modification_ts
 

Additional Inherited Members

- Private Types inherited from SWC::Core::Vector< Fragment::Ptr >
using value_type = Fragment::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< Fragment::Ptr >
constexpr static SWC_CAN_INLINE size_type max_size () noexcept
 

Detailed Description

Definition at line 19 of file CommitLog.h.

Member Typedef Documentation

◆ CompactGroups

◆ Ptr

Definition at line 28 of file CommitLog.h.

◆ Vec

Constructor & Destructor Documentation

◆ Fragments() [1/3]

SWC_CAN_INLINE SWC::Ranger::CommitLog::Fragments::Fragments ( const DB::Types::KeySeq  key_seq)
explicit

Definition at line 18 of file CommitLog.cc.

◆ Fragments() [2/3]

SWC::Ranger::CommitLog::Fragments::Fragments ( const Fragments )
delete

◆ Fragments() [3/3]

SWC::Ranger::CommitLog::Fragments::Fragments ( const Fragments &&  )
delete

◆ ~Fragments()

SWC::Ranger::CommitLog::Fragments::~Fragments ( )
noexcept

Definition at line 30 of file CommitLog.cc.

References SWC::System::Resources::less_mem_releasable(), m_releasable_bytes, and SWC::Env::Rgr::res().

+ Here is the call graph for this function:

Member Function Documentation

◆ _add() [1/2]

SWC_CAN_INLINE void SWC::Ranger::CommitLog::Fragments::_add ( const DB::Cells::Cell cell,
size_t *  offset_itp,
size_t *  offsetp 
)
inline

Definition at line 61 of file CommitLog.h.

References SWC::DB::Cells::MutableVec::add_raw(), and m_cells.

Referenced by _commit(), add(), and take_ownership().

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

◆ _add() [2/2]

void SWC::Ranger::CommitLog::Fragments::_add ( Fragment::Ptr frag)
private

Definition at line 191 of file CommitLog.cc.

References _narrow(), SWC::Core::Vector< Fragment::Ptr >::cbegin(), SWC::Core::Vector< Fragment::Ptr >::cend(), SWC::DB::KeySeq::compare(), SWC::Condition::GT, SWC::Core::Vector< Fragment::Ptr >::insert(), SWC::DB::Cells::MutableVec::key_seq, m_cells, and SWC::Core::Vector< Fragment::Ptr >::push_back().

+ Here is the call graph for this function:

◆ _commit()

◆ _load_cells()

SWC_CAN_INLINE void SWC::Ranger::CommitLog::Fragments::_load_cells ( BlockLoader loader,
Fragments::Vec frags,
uint8_t &  vol 
)
private

Definition at line 349 of file CommitLog.cc.

References SWC::Ranger::BlockLoader::block, SWC::Core::Vector< T, SizeT, GROW_SZ >::cbegin(), SWC::Core::Vector< T, SizeT, GROW_SZ >::cend(), SWC::Ranger::Block::is_consist(), and SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back().

Referenced by load_cells().

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

◆ _narrow()

SWC_CAN_INLINE size_t SWC::Ranger::CommitLog::Fragments::_narrow ( const DB::Cell::Key key) const
private

Definition at line 706 of file CommitLog.cc.

References SWC::Core::Vector< Fragment::Ptr >::cbegin(), SWC::DB::KeySeq::compare(), SWC::DB::Cell::Key::empty(), SWC::Condition::GT, SWC::DB::Cells::MutableVec::key_seq, m_cells, SWC::Ranger::CommitLog::MAX_FRAGMENTS_NARROW, and SWC::Core::Vector< Fragment::Ptr >::size().

Referenced by _add().

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

◆ _need_compact()

◆ _need_compact_major()

bool SWC::Ranger::CommitLog::Fragments::_need_compact_major ( )
private

Definition at line 667 of file CommitLog.cc.

References range, and SWC::Core::Vector< Fragment::Ptr >::size().

Referenced by try_compact().

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

◆ _need_roll()

SWC_CAN_INLINE bool SWC::Ranger::CommitLog::Fragments::_need_roll ( ) const
privatenoexcept

Definition at line 594 of file CommitLog.cc.

References SWC::DB::Cells::MutableVec::empty(), m_cells, SWC::System::Resources::need_ram(), range, SWC::Env::Rgr::res(), SWC::DB::Cells::MutableVec::size(), and SWC::DB::Cells::MutableVec::size_bytes().

Referenced by _commit(), and commit().

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

◆ _next_id()

SWC_CAN_INLINE uint64_t SWC::Ranger::CommitLog::Fragments::_next_id ( )
private

Definition at line 555 of file CommitLog.cc.

References SWC::LOG_WARN, m_last_id, SWC::Time::now_ns(), SWC_LOG_OSTREAM, and SWC_LOG_OUT.

Referenced by _commit(), and next_id().

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

◆ _processing()

SWC_CAN_INLINE bool SWC::Ranger::CommitLog::Fragments::_processing ( ) const
privatenoexcept

Definition at line 685 of file CommitLog.cc.

References m_commit.

Referenced by print(), and processing().

+ Here is the caller graph for this function:

◆ _remove()

void SWC::Ranger::CommitLog::Fragments::_remove ( int &  err,
Fragments::Vec fragments_old,
Core::Semaphore semp 
)
private

Definition at line 389 of file CommitLog.cc.

References SWC::Core::Semaphore::acquire(), SWC::Core::Vector< Fragment::Ptr >::cbegin(), SWC::Core::Vector< Fragment::Ptr >::cend(), and SWC::Core::Vector< Fragment::Ptr >::erase().

Referenced by remove(), and take_ownership().

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

◆ _size_bytes()

size_t SWC::Ranger::CommitLog::Fragments::_size_bytes ( bool  only_loaded = false)
private

Definition at line 694 of file CommitLog.cc.

References m_cells, m_mutex_cells, size(), and SWC::DB::Cells::MutableVec::size_bytes().

Referenced by print(), and size_bytes().

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

◆ add() [1/2]

SWC_CAN_INLINE void SWC::Ranger::CommitLog::Fragments::add ( const DB::Cells::Cell cell)

Definition at line 54 of file CommitLog.cc.

References SWC::DB::Cells::MutableVec::add_raw(), m_cells, and m_mutex_cells.

Referenced by SWC::Ranger::Blocks::add_logged(), load(), SWC::Ranger::CommitLog::Fragment::split(), and take_ownership().

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

◆ add() [2/2]

SWC_CAN_INLINE void SWC::Ranger::CommitLog::Fragments::add ( Fragment::Ptr frag)

Definition at line 186 of file CommitLog.cc.

References _add(), and m_mutex.

+ Here is the call graph for this function:

◆ cells_count()

size_t SWC::Ranger::CommitLog::Fragments::cells_count ( bool  only_current = false)

Definition at line 499 of file CommitLog.cc.

References m_cells, m_mutex, m_mutex_cells, and SWC::DB::Cells::MutableVec::size().

Referenced by _commit(), and print().

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

◆ cells_mutex()

SWC_CAN_INLINE std::shared_mutex& SWC::Ranger::CommitLog::Fragments::cells_mutex ( )
inlinenoexcept

Definition at line 56 of file CommitLog.h.

References m_mutex_cells.

◆ check_sequence()

SWC_CAN_INLINE void SWC::Ranger::CommitLog::Fragments::check_sequence ( const char *  msg,
bool  w_assert = true 
)
inline

Definition at line 67 of file CommitLog.h.

References SWC::DB::Cells::MutableVec::check_sequence(), m_cells, and m_mutex_cells.

+ Here is the call graph for this function:

◆ commit()

void SWC::Ranger::CommitLog::Fragments::commit ( )
noexcept

Definition at line 59 of file CommitLog.cc.

References _commit(), _need_roll(), SWC::System::Resources::adj_mem_releasable(), SWC::Core::AtomicBase< T, OrderT >::exchange(), m_cells, m_commit, m_modification_ts, m_mutex_cells, m_releasable_bytes, SWC::Time::now_ns(), SWC::Env::Rgr::post(), SWC::Env::Rgr::res(), SWC::Ranger::run(), SWC::Core::StateRunning::running(), SWC::DB::Cells::MutableVec::size_of_internal(), SWC::Core::StateRunning::stop(), SWC::Core::AtomicBase< T, OrderT >::store(), and SWC_CAN_INLINE.

Referenced by SWC::Ranger::Range::_run_add_queue().

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

◆ commit_finalize()

void SWC::Ranger::CommitLog::Fragments::commit_finalize ( )

Definition at line 90 of file CommitLog.cc.

References _commit(), m_commit, m_compacting, m_cv, m_mutex, and SWC::Core::StateRunning::running().

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

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

◆ commit_release()

size_t SWC::Ranger::CommitLog::Fragments::commit_release ( )

Definition at line 82 of file CommitLog.cc.

References _commit(), m_commit, m_compacting, m_mutex, m_releasable_bytes, and SWC::Core::StateRunning::running().

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

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

◆ deleting()

bool SWC::Ranger::CommitLog::Fragments::deleting ( )

Definition at line 494 of file CommitLog.cc.

References m_deleting, and m_mutex.

◆ empty()

SWC_CAN_INLINE bool SWC::Ranger::CommitLog::Fragments::empty ( )

Definition at line 514 of file CommitLog.cc.

References SWC::Core::Vector< Fragment::Ptr >::empty(), SWC::DB::Cells::MutableVec::empty(), m_cells, m_mutex, and m_mutex_cells.

Referenced by SWC::Ranger::Range::can_be_merged().

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

◆ expand()

void SWC::Ranger::CommitLog::Fragments::expand ( DB::Cells::Interval intval)

Definition at line 322 of file CommitLog.cc.

References SWC::DB::Cells::Interval::expand(), and m_mutex.

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::CommitLog::Fragments::expand_and_align ( DB::Cells::Interval intval)

Definition at line 328 of file CommitLog.cc.

References SWC::DB::Cells::Interval::align(), SWC::DB::Cells::Interval::expand(), and m_mutex.

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

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

◆ finish_compact()

void SWC::Ranger::CommitLog::Fragments::finish_compact ( const Compact compact)

Definition at line 263 of file CommitLog.cc.

References SWC::Ranger::Range::COMPACT_NONE, SWC::Env::Rgr::log_compact_finished(), m_compacting, m_cv, m_mutex, range, SWC::Ranger::CommitLog::Compact::repetition, stopping, SWC::Core::AtomicBase< T, OrderT >::store(), and try_compact().

Referenced by SWC::Ranger::CommitLog::Compact::Compact(), SWC::Ranger::CommitLog::Compact::finalized(), and try_compact().

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

◆ get()

void SWC::Ranger::CommitLog::Fragments::get ( Fragments::Vec fragments)

Definition at line 362 of file CommitLog.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::assign(), SWC::Core::Vector< Fragment::Ptr >::cbegin(), SWC::Core::Vector< Fragment::Ptr >::cend(), and m_mutex.

+ Here is the call graph for this function:

◆ get_log_fragment() [1/2]

std::string SWC::Ranger::CommitLog::Fragments::get_log_fragment ( const int64_t  frag) const

Definition at line 279 of file CommitLog.cc.

References SWC::DB::RangeBase::LOG_DIR, range, and SWC::Core::to_string().

Referenced by _commit(), load(), and take_ownership().

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

◆ get_log_fragment() [2/2]

std::string SWC::Ranger::CommitLog::Fragments::get_log_fragment ( const std::string &  frag) const

Definition at line 289 of file CommitLog.cc.

References SWC::DB::RangeBase::LOG_DIR, and range.

◆ init()

SWC_CAN_INLINE void SWC::Ranger::CommitLog::Fragments::init ( const RangePtr for_range)

Definition at line 35 of file CommitLog.cc.

References range, and schema_update().

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

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

◆ is_compacting()

SWC_CAN_INLINE bool SWC::Ranger::CommitLog::Fragments::is_compacting ( ) const

Definition at line 205 of file CommitLog.cc.

References m_compacting.

Referenced by SWC::Ranger::Blocks::_split(), and SWC::Ranger::Blocks::scan().

+ Here is the caller graph for this function:

◆ load()

void SWC::Ranger::CommitLog::Fragments::load ( int &  err)

Definition at line 297 of file CommitLog.cc.

References add(), SWC::Error::FS_PATH_NOT_FOUND, get_log_fragment(), SWC::Env::FsInterface::interface(), SWC::DB::RangeBase::LOG_DIR, SWC::Ranger::CommitLog::Fragment::make_read(), SWC::Error::OK, and range.

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::CommitLog::Fragments::load_cells ( BlockLoader loader,
bool &  is_final,
Fragments::Vec frags,
uint8_t  vol 
)

Definition at line 337 of file CommitLog.cc.

References _load_cells(), SWC::Ranger::BlockLoader::block, SWC::Ranger::Block::load_final(), m_cells, m_mutex, and m_mutex_cells.

Referenced by SWC::Ranger::BlockLoader::load_cells().

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

◆ modification_ts()

SWC_CAN_INLINE int64_t SWC::Ranger::CommitLog::Fragments::modification_ts ( ) const
inlinenoexcept

Definition at line 49 of file CommitLog.h.

References SWC::Core::AtomicBase< T, OrderT >::load(), and m_modification_ts.

+ Here is the call graph for this function:

◆ need_compact()

size_t SWC::Ranger::CommitLog::Fragments::need_compact ( CompactGroups groups,
const Vec without,
size_t  vol 
)

Definition at line 209 of file CommitLog.cc.

References _need_compact(), and m_mutex.

+ Here is the call graph for this function:

◆ next_id()

uint64_t SWC::Ranger::CommitLog::Fragments::next_id ( )

Definition at line 549 of file CommitLog.cc.

References _next_id(), and m_mutex.

Referenced by take_ownership().

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

◆ operator=()

Fragments& SWC::Ranger::CommitLog::Fragments::operator= ( const Fragments )
delete

◆ print()

void SWC::Ranger::CommitLog::Fragments::print ( std::ostream &  out,
bool  minimal 
)

Definition at line 566 of file CommitLog.cc.

References _processing(), _size_bytes(), cells_count(), m_cells, m_mutex, m_mutex_cells, SWC::Core::Vector< Fragment::Ptr >::size(), and SWC::DB::Cells::MutableVec::size().

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::CommitLog::Fragments::processing ( )
noexcept

Definition at line 540 of file CommitLog.cc.

References _processing(), and m_mutex.

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

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

◆ release()

size_t SWC::Ranger::CommitLog::Fragments::release ( size_t  bytes)

Definition at line 367 of file CommitLog.cc.

References m_mutex.

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

+ Here is the caller graph for this function:

◆ remove() [1/3]

void SWC::Ranger::CommitLog::Fragments::remove ( )

Definition at line 409 of file CommitLog.cc.

References SWC::Core::Vector< Fragment::Ptr >::clear(), m_commit, m_compacting, m_cv, m_deleting, m_mutex, m_sem, range, SWC::Core::StateRunning::running(), SWC::Core::StateRunning::stop(), stopping, SWC::Core::AtomicBase< T, OrderT >::store(), and SWC::Core::Semaphore::wait_all().

+ Here is the call graph for this function:

◆ remove() [2/3]

void SWC::Ranger::CommitLog::Fragments::remove ( int &  err,
Fragment::Ptr frag,
bool  remove_file 
)

Definition at line 400 of file CommitLog.cc.

References SWC::Core::Vector< Fragment::Ptr >::cbegin(), SWC::Core::Vector< Fragment::Ptr >::cend(), SWC::Core::Vector< Fragment::Ptr >::erase(), and m_mutex.

+ Here is the call graph for this function:

◆ remove() [3/3]

void SWC::Ranger::CommitLog::Fragments::remove ( int &  err,
Fragments::Vec fragments_old 
)

Definition at line 380 of file CommitLog.cc.

References _remove(), m_mutex, and SWC::Core::Semaphore::wait_all().

Referenced by SWC::Ranger::Blocks::apply_new(), SWC::Ranger::Blocks::remove(), and SWC::Ranger::CommitLog::Splitter::run().

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

◆ schema_update()

SWC_CAN_INLINE void SWC::Ranger::CommitLog::Fragments::schema_update ( )

Definition at line 41 of file CommitLog.cc.

References SWC::DB::Cells::MutableVec::configure(), m_cells, m_mutex_cells, and range.

Referenced by init(), and SWC::Ranger::Blocks::schema_update().

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

◆ size()

size_t SWC::Ranger::CommitLog::Fragments::size ( )
noexcept

Definition at line 522 of file CommitLog.cc.

References m_mutex, and SWC::Core::Vector< Fragment::Ptr >::size().

Referenced by _size_bytes(), SWC::Ranger::CommitLog::Compact::Compact(), SWC::Ranger::CommitLog::Compact::finalized(), and size_bytes_encoded().

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

◆ size_bytes()

SWC_CAN_INLINE size_t SWC::Ranger::CommitLog::Fragments::size_bytes ( bool  only_loaded = false)

Definition at line 528 of file CommitLog.cc.

References _size_bytes().

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

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

◆ size_bytes_encoded()

size_t SWC::Ranger::CommitLog::Fragments::size_bytes_encoded ( )

Definition at line 532 of file CommitLog.cc.

References m_mutex, and size().

+ Here is the call graph for this function:

◆ take_ownership() [1/2]

Fragment::Ptr SWC::Ranger::CommitLog::Fragments::take_ownership ( int &  err,
Fragment::Ptr frag 
)

Definition at line 441 of file CommitLog.cc.

References add(), get_log_fragment(), SWC::Env::FsInterface::interface(), SWC::FS::SmartFd::make_ptr(), SWC::Ranger::CommitLog::Fragment::make_read(), next_id(), SWC::Error::OK, and range.

Referenced by SWC::Ranger::CommitLog::Splitter::run().

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

◆ take_ownership() [2/2]

◆ try_compact()

bool SWC::Ranger::CommitLog::Fragments::try_compact ( uint32_t  tnum = 1)

Definition at line 216 of file CommitLog.cc.

References _need_compact(), _need_compact_major(), SWC::Ranger::Range::COMPACT_COMPACTING, SWC::Ranger::Range::COMPACT_PREPARING, SWC::Env::Rgr::compaction_schedule(), SWC::Core::AtomicBase< T, OrderT >::compare_exchange_weak(), finish_compact(), SWC::Env::Rgr::log_compact_finished(), SWC::Env::Rgr::log_compact_possible(), m_compacting, m_cv, m_mutex, range, SWC::Env::Rgr::res(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), stopping, and SWC::Core::AtomicBase< T, OrderT >::store().

Referenced by _commit(), and finish_compact().

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

◆ unload()

void SWC::Ranger::CommitLog::Fragments::unload ( )

Definition at line 427 of file CommitLog.cc.

References SWC::Core::Vector< Fragment::Ptr >::clear(), m_commit, m_compacting, m_cv, m_mutex, range, SWC::Core::StateRunning::running(), SWC::Core::StateRunning::stop(), stopping, and SWC::Core::AtomicBase< T, OrderT >::store().

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

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

Member Data Documentation

◆ m_cells

DB::Cells::MutableVec SWC::Ranger::CommitLog::Fragments::m_cells
private

◆ m_commit

Core::StateRunning SWC::Ranger::CommitLog::Fragments::m_commit
private

Definition at line 164 of file CommitLog.h.

Referenced by _commit(), _processing(), commit(), commit_finalize(), commit_release(), remove(), and unload().

◆ m_compacting

Core::AtomicBool SWC::Ranger::CommitLog::Fragments::m_compacting
private

◆ m_cv

std::condition_variable_any SWC::Ranger::CommitLog::Fragments::m_cv
private

Definition at line 169 of file CommitLog.h.

Referenced by _commit(), commit_finalize(), finish_compact(), remove(), try_compact(), and unload().

◆ m_deleting

bool SWC::Ranger::CommitLog::Fragments::m_deleting
private

Definition at line 168 of file CommitLog.h.

Referenced by _commit(), deleting(), and remove().

◆ m_last_id

uint64_t SWC::Ranger::CommitLog::Fragments::m_last_id
private

Definition at line 171 of file CommitLog.h.

Referenced by _next_id().

◆ m_modification_ts

Core::Atomic<size_t> SWC::Ranger::CommitLog::Fragments::m_modification_ts
private

Definition at line 173 of file CommitLog.h.

Referenced by commit(), and modification_ts().

◆ m_mutex

◆ m_mutex_cells

std::shared_mutex SWC::Ranger::CommitLog::Fragments::m_mutex_cells
private

◆ m_releasable_bytes

Core::Atomic<size_t> SWC::Ranger::CommitLog::Fragments::m_releasable_bytes
private

Definition at line 172 of file CommitLog.h.

Referenced by _commit(), commit(), commit_release(), and ~Fragments().

◆ m_sem

Core::Semaphore SWC::Ranger::CommitLog::Fragments::m_sem
private

Definition at line 170 of file CommitLog.h.

Referenced by _commit(), and remove().

◆ range

◆ stopping


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