#include <swcdb/db/Cells/CellKey.h>
Public Types | |
typedef std::shared_ptr< Key > | Ptr |
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 |
Key & | operator= (const Key &)=delete |
SWC_CAN_INLINE Key & | operator= (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) |
typedef std::shared_ptr<Key> SWC::DB::Cell::Key::Ptr |
|
inlineexplicitconstexprnoexcept |
|
explicit |
|
explicit |
|
explicit |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlineprivate |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 86 of file CellKey.h.
Referenced by add(), SWC::DB::Specs::Interval::apply_possible_range(), SWC::Common::Query::Update::Metric::Item_Net< SWC::Comm::Protocol::FsBroker::Commands >::definitions(), SWC::Common::Query::Update::Metric::Item_Mem::definitions(), SWC::Common::Query::Update::Metric::Item_CPU::definitions(), SWC::Common::Query::Update::Metric::Item_FS::definitions(), SWC::FsBroker::Metric::Item_Fds::definitions(), SWC::DB::Specs::Key::get(), insert(), SWC::Utils::LoadGenerator::KeyGeneratorUpdate::next(), SWC::Ranger::Range::on_change(), read(), SWC::DB::Cells::TSV::FileReader::read(), SWC::client::SQL::Reader::read_key(), SWC::Common::Query::Update::Metric::Item_Net< SWC::Comm::Protocol::FsBroker::Commands >::report(), SWC::Common::Query::Update::Metric::Item_Mem::report(), SWC::Common::Query::Update::Metric::Item_CPU::report(), SWC::Common::Query::Update::Metric::Item_FS::report(), SWC::client::Query::Update::Handlers::Metric::Item_MinMaxAvgCount::report(), SWC::client::Query::Update::Handlers::Metric::Item_Count::report(), SWC::client::Query::Update::Handlers::Metric::Item_Volume::report(), SWC::client::Query::Update::Handlers::Metric::Item_CountVolume::report(), SWC::DB::RgrData::set_delete_cell(), and SWC::DB::RgrData::set_insert_cell().
|
inline |
|
inline |
Definition at line 109 of file CellKey.h.
References count, data, SWC::Serialization::encode_vi24(), SWC::Serialization::encoded_length_vi24(), own, and size.
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.
|
inline |
Definition at line 199 of file CellKey.h.
References count, data, and SWC::Serialization::decode_vi24().
Referenced by SWC::Thrift::Converter::set().
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().
Definition at line 14 of file CellKey.cc.
References _data(), _free(), count, data, SWC::Serialization::decode_vi24(), own, and size.
SWC_CAN_INLINE void SWC::DB::Cell::Key::decode | ( | const uint8_t ** | bufp, |
size_t * | remainp, | ||
bool | owner | ||
) |
Definition at line 337 of file CellKey.h.
References _data(), _free(), count, data, SWC::Serialization::decode_vi24(), own, and size.
Referenced by SWC::DB::Cells::Cell::Cell(), SWC::Ranger::Range::check_meta(), SWC::DB::Specs::Interval::decode(), SWC::DB::Cell::Serial::Value::Field_KEY::decode(), SWC::DB::Cells::Interval::decode(), SWC::DB::Cells::Cell::display(), SWC::Manager::ColumnHealthCheck::ColumnMerger::RangesMerger::handle(), SWC::Comm::Protocol::Mngr::Params::RgrGetReq::internal_decode(), SWC::Comm::Protocol::Mngr::Params::RgrGetRsp::internal_decode(), SWC::Comm::Protocol::Rgr::Params::RangeLocateReq::internal_decode(), SWC::Comm::Protocol::Rgr::Params::RangeLocateRsp::internal_decode(), SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::internal_decode(), SWC::Ranger::CellStore::Read::load_blocks_index(), SWC::DB::Cells::Cell::read(), SWC::Manager::ColumnHealthCheck::ColumnMerger::run(), SWC::Ranger::Callback::RangeLocateScan::selector(), and SWC::Ranger::Callback::RangeLocateScanCommit::selector().
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().
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().
|
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().
SWC_CAN_INLINE void SWC::DB::Cell::Key::encode | ( | uint8_t ** | bufp | ) | const |
Definition at line 328 of file CellKey.h.
References count, data, SWC::Serialization::encode_vi24(), and size.
Referenced by SWC::DB::Specs::Interval::encode(), SWC::DB::Cell::Serial::Value::Field_KEY::encode(), SWC::DB::Cells::Interval::encode(), SWC::Comm::Protocol::Mngr::Params::RgrGetReq::internal_encode(), SWC::Comm::Protocol::Mngr::Params::RgrGetRsp::internal_encode(), SWC::Comm::Protocol::Rgr::Params::RangeLocateReq::internal_encode(), SWC::Comm::Protocol::Rgr::Params::RangeLocateRsp::internal_encode(), SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::internal_encode(), SWC::DB::Cells::Cell::write(), and SWC::Ranger::CellStore::Write::write_blocks_index().
|
constexprnoexcept |
Definition at line 323 of file CellKey.h.
References count, SWC::Serialization::encoded_length_vi24(), and size.
Referenced by SWC::DB::Cells::Interval::encoded_length(), SWC::DB::Specs::Interval::encoded_length(), SWC::DB::Cell::Serial::Value::Field_KEY::encoded_length(), SWC::DB::Cells::Cell::encoded_length(), SWC::Comm::Protocol::Mngr::Params::RgrGetReq::internal_encoded_length(), SWC::Comm::Protocol::Mngr::Params::RgrGetRsp::internal_encoded_length(), SWC::Comm::Protocol::Rgr::Params::RangeLocateReq::internal_encoded_length(), SWC::Comm::Protocol::Rgr::Params::RangeLocateRsp::internal_encoded_length(), SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::internal_encoded_length(), SWC::Ranger::Range::on_change(), and SWC::Ranger::CellStore::Write::write_blocks_index().
|
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().
|
inline |
Definition at line 215 of file CellKey.h.
References count, data, SWC::Serialization::decode_vi24(), and SWC::Condition::eq().
|
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().
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().
|
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().
|
inline |
|
inline |
|
inline |
Definition at line 150 of file CellKey.h.
Referenced by insert(), 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::Ranger::Range::on_change(), SWC::client::Query::Select::Scanner::rgr_locate_master(), and SWC::client::Query::Select::Scanner::rgr_locate_meta().
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.
|
noexcept |
Definition at line 302 of file CellKey.h.
Referenced by SWC::Ranger::Block::_split(), and operator=().
|
inlinenoexcept |
void SWC::DB::Cell::Key::print | ( | std::ostream & | out | ) | const |
Definition at line 182 of file CellKey.cc.
References display_details(), and size.
Referenced by SWC::Ranger::CompactRange::initial_commitlog_done(), SWC::Ranger::Block::load_cells(), SWC::client::Query::Select::Scanner::mngr_locate_master(), SWC::client::Query::Update::Committer::print(), SWC::DB::Specs::Interval::print(), SWC::Comm::Protocol::Mngr::Params::RgrGetReq::print(), SWC::Comm::Protocol::Mngr::Params::RgrGetRsp::print(), SWC::Comm::Protocol::Rgr::Params::RangeLocateReq::print(), SWC::Comm::Protocol::Rgr::Params::RangeLocateRsp::print(), SWC::Comm::Protocol::Rgr::Params::RangeQueryUpdateRsp::print(), SWC::Ranger::Range::print(), SWC::DB::Cells::Cell::print(), SWC::Ranger::CompactRange::response(), and to_string().
|
inline |
Definition at line 144 of file CellKey.h.
Referenced by SWC::Thrift::Converter::set(), and SWC::ThriftBroker::AppHandler::set().
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().
|
inlineconstexprnoexcept |
|
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().
|
friend |
uint24_t SWC::DB::Cell::Key::count |
Definition at line 255 of file CellKey.h.
Referenced by add(), SWC::DB::KeySeq::align(), SWC::DB::KeySeq::compare(), SWC::DB::KeySeq::compare< Types::KeySeq::FC_LEXIC >(), SWC::DB::KeySeq::compare< Types::KeySeq::FC_VOLUME >(), SWC::DB::KeySeq::compare_opt(), SWC::DB::KeySeq::compare_opt< Types::KeySeq::FC_LEXIC >(), SWC::DB::KeySeq::compare_opt< Types::KeySeq::FC_VOLUME >(), convert_to(), copy(), decode(), display(), display_details(), empty(), encode(), encoded_length(), equal(), free(), get(), insert(), SWC::DB::Specs::Interval::is_in_previous(), SWC::DB::Specs::Key::is_matching(), SWC::DB::Specs::Interval::is_matching_begin(), SWC::DB::Specs::Interval::is_matching_end(), Key(), SWC::Ranger::Range::known_interval_count(), SWC::client::Query::Update::Committer::locate_on_manager(), SWC::client::Query::Update::Committer::located_on_manager(), SWC::Ranger::Callback::RangeLocateScan::RangeLocateScan(), remove(), sane(), SWC::Ranger::Callback::RangeLocateScan::selector(), SWC::Ranger::Callback::RangeLocateScanCommit::selector(), SWC::DB::Specs::Key::set(), and SWC::DB::Cells::TSV::FileWriter::write().
uint8_t* SWC::DB::Cell::Key::data |
Definition at line 257 of file CellKey.h.
Referenced by _free(), add(), SWC::DB::KeySeq::align(), SWC::DB::KeySeq::compare(), SWC::DB::KeySeq::compare_opt(), convert_to(), copy(), decode(), display(), encode(), equal(), free(), get(), insert(), SWC::DB::Specs::Key::is_matching(), Key(), remove(), sane(), SWC::DB::Specs::Key::set(), and SWC::DB::Cells::TSV::FileWriter::write().
bool SWC::DB::Cell::Key::own |
uint32_t SWC::DB::Cell::Key::size |
Definition at line 256 of file CellKey.h.
Referenced by _data(), SWC::Ranger::Block::_releasing_size(), add(), copy(), decode(), display_details(), encode(), encoded_length(), equal(), free(), insert(), Key(), print(), remove(), sane(), SWC::DB::Cells::Interval::size_of_internal(), and SWC::DB::Specs::Interval::size_of_internal().