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::DB::Cell::Key Class Referencefinal

#include <swcdb/db/Cells/CellKey.h>

Public Types

typedef std::shared_ptr< KeyPtr
 

Public Member Functions

constexpr SWC_CAN_INLINE Key () noexcept
 
 Key (const uint8_t **bufp, size_t *remainp, bool owner)
 
 Key (const Key &other)
 
 Key (const Key &other, bool own)
 
constexpr SWC_CAN_INLINE Key (Key &&other) noexcept
 
Keyoperator= (const Key &)=delete
 
SWC_CAN_INLINE Keyoperator= (Key &&other) noexcept
 
void move (Key &other) noexcept
 
void copy (const Key &other)
 
void copy (uint24_t after_idx, const Key &other)
 
SWC_CAN_INLINE ~Key () noexcept
 
SWC_CAN_INLINE void _free () noexcept
 
SWC_CAN_INLINE void free () noexcept
 
constexpr SWC_CAN_INLINE bool sane () const noexcept
 
SWC_CAN_INLINE void add (const std::string_view &fraction)
 
SWC_CAN_INLINE void add (const std::string &fraction)
 
SWC_CAN_INLINE void add (const char *fraction)
 
SWC_CAN_INLINE void add (const char *fraction, uint32_t len)
 
void add (const uint8_t *fraction, uint24_t len)
 
template<typename T >
SWC_CAN_INLINE void add (const T cbegin, const T cend)
 
template<typename T >
SWC_CAN_INLINE void add (const T &key)
 
template<typename T >
SWC_CAN_INLINE void read (const T &key)
 
SWC_CAN_INLINE void insert (uint32_t idx, const std::string &fraction)
 
SWC_CAN_INLINE void insert (uint32_t idx, const char *fraction)
 
SWC_CAN_INLINE void insert (uint32_t idx, const char *fraction, uint32_t len)
 
void insert (uint32_t idx, const uint8_t *fraction, uint24_t len)
 
void remove (uint32_t idx, bool recursive=false)
 
SWC_CAN_INLINE std::string get_string (uint32_t idx) const
 
void get (uint32_t idx, const char **fraction, uint32_t *length) const
 
constexpr SWC_CAN_INLINE bool equal (const Key &other) const noexcept
 
constexpr SWC_CAN_INLINE bool empty () const noexcept
 
constexpr uint32_t encoded_length () const noexcept
 
void encode (uint8_t **bufp) const
 
void decode (const uint8_t **bufp, size_t *remainp, bool owner)
 
template<typename T >
SWC_CAN_INLINE void convert_to (T &key) const
 
template<typename T >
SWC_CAN_INLINE bool equal (const T &key) const
 
SWC_CAN_INLINE std::string to_string () const
 
void display (std::ostream &out, bool pretty=true, const char *sep=",") const
 
void display_details (std::ostream &out, bool pretty=true) const
 
void print (std::ostream &out) const
 

Public Attributes

bool own
 
uint24_t count
 
uint32_t size
 
uint8_t * data
 

Private Member Functions

SWC_CAN_INLINE uint8_t * _data (const uint8_t *ptr)
 

Friends

std::ostream & operator<< (std::ostream &out, const Key &key)
 

Detailed Description

Definition at line 24 of file CellKey.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Key> SWC::DB::Cell::Key::Ptr

Definition at line 27 of file CellKey.h.

Constructor & Destructor Documentation

◆ Key() [1/5]

constexpr SWC_CAN_INLINE SWC::DB::Cell::Key::Key ( )
inlineexplicitconstexprnoexcept

Definition at line 30 of file CellKey.h.

◆ Key() [2/5]

SWC_CAN_INLINE SWC::DB::Cell::Key::Key ( const uint8_t **  bufp,
size_t *  remainp,
bool  owner 
)
explicit

Definition at line 272 of file CellKey.h.

References _data(), count, data, SWC::Serialization::decode_vi24(), own, and size.

+ Here is the call graph for this function:

◆ Key() [3/5]

SWC_CAN_INLINE SWC::DB::Cell::Key::Key ( const Key other)
explicit

Definition at line 290 of file CellKey.h.

◆ Key() [4/5]

SWC_CAN_INLINE SWC::DB::Cell::Key::Key ( const Key other,
bool  own 
)
explicit

Definition at line 296 of file CellKey.h.

◆ Key() [5/5]

constexpr SWC_CAN_INLINE SWC::DB::Cell::Key::Key ( Key &&  other)
inlineconstexprnoexcept

Definition at line 39 of file CellKey.h.

◆ ~Key()

SWC_CAN_INLINE SWC::DB::Cell::Key::~Key ( )
inlinenoexcept

Definition at line 62 of file CellKey.h.

References _free().

+ Here is the call graph for this function:

Member Function Documentation

◆ _data()

SWC_CAN_INLINE uint8_t* SWC::DB::Cell::Key::_data ( const uint8_t *  ptr)
inlineprivate

Definition at line 262 of file CellKey.h.

References size.

Referenced by copy(), decode(), Key(), and remove().

+ Here is the caller graph for this function:

◆ _free()

SWC_CAN_INLINE void SWC::DB::Cell::Key::_free ( )
inlinenoexcept

Definition at line 67 of file CellKey.h.

References data, and own.

Referenced by copy(), decode(), free(), and ~Key().

+ Here is the caller graph for this function:

◆ add() [1/7]

SWC_CAN_INLINE void SWC::DB::Cell::Key::add ( const char *  fraction)
inline

Definition at line 96 of file CellKey.h.

References add().

+ Here is the call graph for this function:

◆ add() [2/7]

SWC_CAN_INLINE void SWC::DB::Cell::Key::add ( const char *  fraction,
uint32_t  len 
)
inline

Definition at line 101 of file CellKey.h.

References add().

+ Here is the call graph for this function:

◆ add() [3/7]

SWC_CAN_INLINE void SWC::DB::Cell::Key::add ( const std::string &  fraction)
inline

Definition at line 91 of file CellKey.h.

References add().

+ Here is the call graph for this function:

◆ add() [4/7]

SWC_CAN_INLINE void SWC::DB::Cell::Key::add ( const std::string_view &  fraction)
inline

◆ add() [5/7]

template<typename T >
SWC_CAN_INLINE void SWC::DB::Cell::Key::add ( const T &  key)
inline

Definition at line 138 of file CellKey.h.

References add().

+ Here is the call graph for this function:

◆ add() [6/7]

template<typename T >
SWC_CAN_INLINE void SWC::DB::Cell::Key::add ( const T  cbegin,
const T  cend 
)
inline

Definition at line 109 of file CellKey.h.

References count, data, SWC::Serialization::encode_vi24(), SWC::Serialization::encoded_length_vi24(), own, and size.

+ Here is the call graph for this function:

◆ add() [7/7]

void SWC::DB::Cell::Key::add ( const uint8_t *  fraction,
uint24_t  len 
)

Definition at line 31 of file CellKey.cc.

References count, data, SWC::Serialization::encode_vi24(), SWC::Serialization::encoded_length_vi24(), own, and size.

+ Here is the call graph for this function:

◆ convert_to()

template<typename T >
SWC_CAN_INLINE void SWC::DB::Cell::Key::convert_to ( T &  key) const
inline

Definition at line 199 of file CellKey.h.

References count, data, and SWC::Serialization::decode_vi24().

Referenced by SWC::Thrift::Converter::set().

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

◆ copy() [1/2]

SWC_CAN_INLINE void SWC::DB::Cell::Key::copy ( const Key other)

Definition at line 314 of file CellKey.h.

References _data(), _free(), count, data, own, and size.

Referenced by SWC::Ranger::Range::_get_interval(), SWC::Ranger::Range::_run_add_queue(), SWC::Ranger::Block::_set_key_end(), SWC::Ranger::Block::_set_prev_key_end(), SWC::Ranger::Block::_split(), SWC::client::Query::Select::Handlers::BaseSingleColumn::add_cells(), SWC::client::Query::Select::Handlers::BaseUnorderedMap::Rsp::add_cells(), SWC::DB::Specs::Interval::apply_possible_range_begin(), SWC::DB::Specs::Interval::apply_possible_range_end(), SWC::client::Managers::MasterRangesCache::Range::change(), SWC::Ranger::Range::check_meta(), SWC::DB::Cells::Cell::copy(), SWC::DB::Specs::Interval::copy(), SWC::Ranger::Range::expand_and_align(), SWC::DB::Cells::Interval::expand_begin(), SWC::DB::Cells::Interval::expand_end(), SWC::DB::Cells::Mutable::get(), SWC::Manager::Range::get_interval(), SWC::Ranger::CellStore::Readers::get_key_end(), SWC::Ranger::CellStore::Readers::get_prev_key_end(), SWC::client::Managers::MasterRangesCache::Column::get_read(), SWC::client::Managers::MasterRangesCache::Column::get_write(), SWC::Ranger::CompactRange::initial_commitlog_done(), SWC::Ranger::CellStore::Read::load_blocks_index(), SWC::client::Query::Update::Committer::locate_on_manager(), SWC::client::Query::Update::Committer::locate_on_ranger(), SWC::client::Query::Select::Scanner::mngr_locate_master(), SWC::client::Query::Select::Scanner::mngr_located_master(), SWC::Ranger::Range::on_change(), SWC::Comm::Protocol::Rgr::Handler::RangeLocate::operator()(), SWC::Ranger::CompactRange::response(), SWC::client::Query::Select::Scanner::rgr_locate_master(), SWC::client::Query::Select::Scanner::rgr_locate_meta(), SWC::client::Query::Select::Scanner::rgr_located_master(), SWC::client::Query::Select::Scanner::rgr_located_meta(), SWC::Ranger::Callback::RangeLocateScan::selector(), SWC::Ranger::Callback::RangeLocateScanCommit::selector(), SWC::Manager::Range::set(), SWC::DB::Cells::Interval::set_key_begin(), SWC::DB::Cells::Interval::set_key_end(), and SWC::Ranger::CompactRange::InBlock::set_offset().

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

◆ copy() [2/2]

void SWC::DB::Cell::Key::copy ( uint24_t  after_idx,
const Key other 
)

Definition at line 14 of file CellKey.cc.

References _data(), _free(), count, data, SWC::Serialization::decode_vi24(), own, and size.

+ Here is the call graph for this function:

◆ decode()

◆ display()

void SWC::DB::Cell::Key::display ( std::ostream &  out,
bool  pretty = true,
const char *  sep = "," 
) const

Definition at line 152 of file CellKey.cc.

References count, data, and SWC::Serialization::decode_vi24().

Referenced by SWC::DB::Cells::Cell::display(), display_details(), and SWC::DB::Cell::Serial::Value::Field_KEY::print().

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

◆ display_details()

void SWC::DB::Cell::Key::display_details ( std::ostream &  out,
bool  pretty = true 
) const

Definition at line 147 of file CellKey.cc.

References count, display(), and size.

Referenced by SWC::DB::Specs::Interval::display(), and print().

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

◆ empty()

constexpr SWC_CAN_INLINE bool SWC::DB::Cell::Key::empty ( ) const
inlineconstexprnoexcept

Definition at line 186 of file CellKey.h.

References count.

Referenced by SWC::Ranger::Block::_includes_begin(), SWC::Ranger::Range::_is_any_begin(), SWC::Ranger::Range::_is_any_end(), SWC::Ranger::Block::_is_in_end(), SWC::Ranger::CommitLog::Fragments::_narrow(), SWC::Ranger::Blocks::_narrow(), SWC::Ranger::Range::_run_add_queue(), SWC::DB::Cells::Mutable::add_raw(), SWC::DB::Specs::Interval::apply_possible_range_begin(), SWC::DB::Specs::Interval::apply_possible_range_end(), SWC::DB::Specs::Interval::apply_possible_range_pure(), SWC::Manager::Range::before(), SWC::Ranger::CellStore::create_initial(), SWC::DB::Cells::Interval::expand_begin(), SWC::DB::Cells::Interval::expand_end(), SWC::Ranger::CompactRange::finalize(), SWC::DB::Cells::Mutable::get(), SWC::client::Query::Update::Handlers::ColumnMutable::get_key_next(), SWC::client::Managers::MasterRangesCache::Column::get_read(), SWC::client::Managers::MasterRangesCache::Column::get_write(), SWC::Manager::Range::includes(), SWC::Ranger::Block::includes_end(), SWC::Ranger::Block::is_consist(), SWC::DB::Cells::Interval::is_in_begin(), SWC::DB::Cells::Interval::is_in_end(), SWC::DB::Specs::Interval::is_in_previous(), SWC::DB::Specs::Interval::is_matching(), SWC::DB::Specs::Interval::is_matching_begin(), SWC::DB::Specs::Interval::is_matching_end(), SWC::Ranger::Block::is_next(), SWC::Ranger::Range::known_interval_count(), SWC::Ranger::Block::load_cells(), SWC::client::Query::Update::Committer::located_on_ranger(), SWC::client::Query::Select::Scanner::mngr_located_master(), SWC::client::Query::Select::Scanner::next_call(), SWC::Ranger::Range::on_change(), SWC::DB::Specs::Interval::print(), SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::print(), SWC::client::Query::Select::Scanner::rgr_locate_meta(), SWC::DB::Cells::Mutable::scan_after(), SWC::DB::Cells::Mutable::scan_version_multi(), SWC::Ranger::Callback::RangeLocateScan::selector(), and SWC::DB::Cells::Mutable::write_and_free().

+ Here is the caller graph for this function:

◆ encode()

SWC_CAN_INLINE void SWC::DB::Cell::Key::encode ( uint8_t **  bufp) const

◆ encoded_length()

◆ equal() [1/2]

constexpr SWC_CAN_INLINE bool SWC::DB::Cell::Key::equal ( const Key other) const
inlineconstexprnoexcept

Definition at line 179 of file CellKey.h.

References count, data, SWC::Condition::eq(), and size.

Referenced by SWC::DB::Cells::Mutable::_finalize_counter(), SWC::DB::Cells::Mutable::_remove_overhead(), SWC::Manager::Range::equal(), SWC::DB::Cells::Interval::equal(), SWC::Ranger::Range::expand_and_align(), SWC::DB::Cells::Mutable::has_one_key(), SWC::Ranger::Range::on_change(), and SWC::DB::Cells::Mutable::scan_version_multi().

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

◆ equal() [2/2]

template<typename T >
SWC_CAN_INLINE bool SWC::DB::Cell::Key::equal ( const T &  key) const
inline

Definition at line 215 of file CellKey.h.

References count, data, SWC::Serialization::decode_vi24(), and SWC::Condition::eq().

+ Here is the call graph for this function:

◆ free()

SWC_CAN_INLINE void SWC::DB::Cell::Key::free ( )
inlinenoexcept

Definition at line 73 of file CellKey.h.

References _free(), count, data, and size.

Referenced by SWC::Ranger::Block::_free_key_end(), SWC::DB::Specs::Interval::apply_possible_range_begin(), SWC::DB::Specs::Interval::apply_possible_range_end(), SWC::DB::Cells::Interval::free(), SWC::DB::Specs::Interval::free(), SWC::DB::Specs::Key::get(), SWC::Ranger::CellStore::Read::load_blocks_index(), SWC::Utils::LoadGenerator::KeyGeneratorUpdate::next(), SWC::client::Query::Select::Scanner::next_call(), and read().

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

◆ get()

void SWC::DB::Cell::Key::get ( uint32_t  idx,
const char **  fraction,
uint32_t *  length 
) const

Definition at line 131 of file CellKey.cc.

References count, data, SWC::Serialization::decode_vi24(), and SWC::Comm::Protocol::FsBroker::Handler::length().

Referenced by get_string().

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

◆ get_string()

SWC_CAN_INLINE std::string SWC::DB::Cell::Key::get_string ( uint32_t  idx) const
inline

Definition at line 169 of file CellKey.h.

References get(), and SWC::Comm::Protocol::FsBroker::Handler::length().

Referenced by SWC::Ranger::Callback::RangeLocateScan::add_cell_and_more().

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

◆ insert() [1/4]

SWC_CAN_INLINE void SWC::DB::Cell::Key::insert ( uint32_t  idx,
const char *  fraction 
)
inline

Definition at line 155 of file CellKey.h.

References insert().

+ Here is the call graph for this function:

◆ insert() [2/4]

SWC_CAN_INLINE void SWC::DB::Cell::Key::insert ( uint32_t  idx,
const char *  fraction,
uint32_t  len 
)
inline

Definition at line 160 of file CellKey.h.

References insert().

+ Here is the call graph for this function:

◆ insert() [3/4]

SWC_CAN_INLINE void SWC::DB::Cell::Key::insert ( uint32_t  idx,
const std::string &  fraction 
)
inline

◆ insert() [4/4]

void SWC::DB::Cell::Key::insert ( uint32_t  idx,
const uint8_t *  fraction,
uint24_t  len 
)

Definition at line 52 of file CellKey.cc.

References add(), count, data, SWC::Serialization::decode_vi24(), SWC::Serialization::encode_vi24(), SWC::Serialization::encoded_length_vi24(), own, and size.

+ Here is the call graph for this function:

◆ move()

SWC_CAN_INLINE void SWC::DB::Cell::Key::move ( Key other)
noexcept

Definition at line 302 of file CellKey.h.

References data, and size.

Referenced by SWC::Ranger::Block::_split(), and operator=().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

Key& SWC::DB::Cell::Key::operator= ( const Key )
delete

◆ operator=() [2/2]

SWC_CAN_INLINE Key& SWC::DB::Cell::Key::operator= ( Key &&  other)
inlinenoexcept

Definition at line 50 of file CellKey.h.

References move().

+ Here is the call graph for this function:

◆ print()

void SWC::DB::Cell::Key::print ( std::ostream &  out) const

◆ read()

template<typename T >
SWC_CAN_INLINE void SWC::DB::Cell::Key::read ( const T &  key)
inline

Definition at line 144 of file CellKey.h.

References add(), and free().

Referenced by SWC::Thrift::Converter::set(), and SWC::ThriftBroker::AppHandler::set().

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

◆ remove()

void SWC::DB::Cell::Key::remove ( uint32_t  idx,
bool  recursive = false 
)

Definition at line 94 of file CellKey.cc.

References _data(), count, data, SWC::Serialization::decode_vi24(), own, and size.

Referenced by SWC::Ranger::Range::check_meta(), SWC::client::Query::Update::Committer::locate_on_manager(), SWC::client::Query::Update::Committer::located_on_manager(), and SWC::Ranger::Callback::RangeLocateScan::RangeLocateScan().

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

◆ sane()

constexpr SWC_CAN_INLINE bool SWC::DB::Cell::Key::sane ( ) const
inlineconstexprnoexcept

Definition at line 81 of file CellKey.h.

References count, data, and size.

◆ to_string()

SWC_CAN_INLINE std::string SWC::DB::Cell::Key::to_string ( ) const
inline

Definition at line 232 of file CellKey.h.

References print().

Referenced by SWC::DB::Cells::Cell::Cell(), SWC::DB::Cells::Cell::get_value(), and SWC::DB::Cells::Cell::read().

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

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const Key key 
)
friend

Definition at line 249 of file CellKey.h.

Member Data Documentation

◆ count

◆ data

◆ own

bool SWC::DB::Cell::Key::own

Definition at line 254 of file CellKey.h.

Referenced by _free(), add(), copy(), decode(), insert(), Key(), and remove().

◆ size


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