|
SWC-DB
v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
|
Go to the documentation of this file.
14 namespace SWC {
namespace client {
namespace Query {
namespace Select {
18 #define SWC_SCANNER_REQ_DEBUG(msg) \
19 SWC_LOG_OUT(LOG_DEBUG, params.print(SWC_LOG_OSTREAM << msg << ' '); );
21 #define SWC_SCANNER_RSP_DEBUG(msg) \
22 SWC_LOG_OUT(LOG_DEBUG, \
23 print(SWC_LOG_OSTREAM << msg << ' '); \
24 rsp.print(SWC_LOG_OSTREAM << ' '); \
44 meta_cid(DB::Types::SystemColumn::
get_meta_cid(col_seq)),
49 master_mngr_revision(0),
50 master_mngr_is_end(false),
51 master_mngr_next(false),
52 master_rgr_next(false),
55 need_data_cid_check(false),
56 master_rgr_req_base(nullptr),
57 meta_req_base(nullptr),
58 data_req_base(nullptr),
63 master_rgr_endpoints(),
71 const cid_t cid) noexcept
75 interval(std::move(a_interval)),
82 master_mngr_revision(0),
83 master_mngr_is_end(
false),
84 master_mngr_next(
false),
85 master_rgr_next(
false),
88 need_data_cid_check(
false),
89 master_rgr_req_base(
nullptr),
90 meta_req_base(
nullptr),
91 data_req_base(
nullptr),
96 master_rgr_endpoints(),
108 <<
" Ranger(cid=" << cid <<
" rid=" << rid <<
" endpoints=[";
109 for(
auto& endpoint : endpoints)
157 noexcept :
scanner(a_scanner) { }
162 return scanner->selector->clients;
166 return scanner->selector->valid();
243 ReqData(
const Ptr& a_scanner,
247 ~ReqData() noexcept { }
252 if(scanner->mngr_located_master(req, rsp))
253 scanner->response_if_last();
258 ::make(params, 10000, shared_from_this(), profile);
262 selector->clients->mngr_cache_get_read_master(
268 <<
"mngr_located_master Cache hit"
293 req->request_again();
301 req->request_again();
316 selector->clients->mngr_cache_set_master(
346 req->request_again();
399 ReqData(
const Ptr& a_scanner) noexcept
401 profile(scanner->selector->profile.rgr_locate(
402 DB::Types::Range::MASTER)) { }
404 ~ReqData() noexcept { }
409 scanner->rgr_located_master(req, rsp);
481 return req->request_again();
495 auto profile =
selector->profile.mngr_res();
510 ReqData(
const Ptr& a_scanner,
514 ~ReqData() noexcept { }
519 if(scanner->mngr_resolved_rgr_meta(req, rsp))
520 scanner->response_if_last();
525 ::request(params, 10000, shared_from_this(), profile);
557 req->request_again();
582 bool range_end_rest =
false;
600 ReqData(
const Ptr& a_scanner) noexcept
602 profile(scanner->selector->profile.rgr_locate(
603 DB::Types::Range::META)) { }
605 ~ReqData() noexcept { }
610 scanner->rgr_located_meta(req, rsp);
689 return req->request_again();
703 auto profile =
selector->profile.mngr_res();
718 ReqData(
const Ptr& a_scanner,
722 ~ReqData() noexcept { }
727 if(scanner->mngr_resolved_rgr_select(req, rsp))
728 scanner->response_if_last();
733 ::request(params, 10000, shared_from_this(), profile);
771 req->request_again();
793 ReqData(
const Ptr& a_scanner) noexcept
795 profile(scanner->selector->profile.rgr_data()) { }
797 ~ReqData() noexcept { }
802 scanner->rgr_selected(req, rsp);
851 return req->request_again();
858 #undef SWC_SCANNER_REQ_DEBUG
859 #undef SWC_SCANNER_RSP_DEBUG
DB::Cell::Key master_mngr_offset
SWC_CAN_INLINE void apply_possible_range(DB::Cell::Key &begin, DB::Cell::Key &end, bool *end_restp=nullptr) const
static const uint8_t RETRY_POINT_MASTER
DB::Specs::Interval interval
static SWC_CAN_INLINE void request(const Ptr &req, const EndPoints &endpoints)
DB::Cell::Key master_rgr_offset
DB::Cell::Key meta_offset
#define SWC_LOG_OUT(pr, _code_)
void mngr_resolve_rgr_select()
DB::Cell::Key range_begin
void debug_res_cache(const char *msg, cid_t cid, rid_t rid, const Comm::EndPoints &endpoints)
constexpr SWC_CAN_INLINE bool is_meta(cid_t cid) noexcept
Comm::EndPoints master_rgr_endpoints
const char *SWC_CONST_FUNC get_meta_cid_str(KeySeq col_seq) noexcept
constexpr SWC_CAN_INLINE bool is_data(cid_t cid) noexcept
static const uint8_t NEXT_RANGE
SWC_CAN_INLINE void insert(uint32_t idx, const std::string &fraction)
const char *SWC_CONST_FUNC to_string(Column typ) noexcept
#define SWC_SCANNER_RSP_DEBUG(msg)
Comm::EndPoints meta_endpoints
cid_t SWC_CONST_FUNC get_master_cid(KeySeq col_seq) noexcept
static const uint8_t HAVE_REVISION
void print(std::ostream &out) const
bool mngr_resolved_rgr_meta(const ReqBase::Ptr &base, Comm::Protocol::Mngr::Params::RgrGetRsp &rsp)
DB::Cell::Key range_begin
bool mngr_located_master(const ReqBase::Ptr &base, Comm::Protocol::Mngr::Params::RgrGetRsp &rsp)
constexpr SWC_CAN_INLINE bool is_master(cid_t cid) noexcept
SWC_CAN_INLINE ReqDataBase(const Scanner::Ptr &a_scanner) noexcept
void print(std::ostream &out)
static SWC_CAN_INLINE Ptr make(const Params::RgrGetReq ¶ms, const uint32_t timeout, DataArgsT &&... args)
SWC_CAN_INLINE ~ReqDataBase() noexcept
constexpr SWC_CAN_INLINE bool empty() const noexcept
static const uint8_t RANGE_END_REST
constexpr SWC_CAN_INLINE bool empty() const noexcept
void rgr_located_meta(const ReqBase::Ptr &base, const Comm::Protocol::Rgr::Params::RangeLocateRsp &rsp)
static const uint8_t RETRY_POINT_META
bool mngr_resolved_rgr_select(const ReqBase::Ptr &base, Comm::Protocol::Mngr::Params::RgrGetRsp &rsp)
DB::Cell::Key range_begin
The SWC-DB C++ namespace 'SWC'.
DB::Cell::Key range_offset
int64_t master_mngr_revision
ReqBase::Ptr meta_req_base
static const uint8_t RETRY_POINT_DATA
constexpr SWC_CAN_INLINE bool has_opt__key_equal() const noexcept
void copy(const Key &other)
DB::Cell::Key range_begin
Handlers::Base::Ptr selector
static SWC_CAN_INLINE void request(const Ptr &req, const EndPoints &endpoints)
constexpr SWC_CAN_INLINE bool has_opt__range_end_rest() const noexcept
static const uint8_t RETRY_POINT_NONE
Core::CompletionCounter< uint64_t > completion
ReqBase::Ptr master_rgr_req_base
std::shared_ptr< Base > Ptr
constexpr SWC_CAN_INLINE CountT count() const noexcept
void mngr_locate_master()
SWC_CAN_INLINE void free() noexcept
Scanner(const Handlers::Base::Ptr &hdlr, const DB::Types::KeySeq col_seq, const DB::Specs::Interval &interval, const cid_t cid)
const DB::Types::KeySeq col_seq
constexpr SWC_CAN_INLINE void increment(CountT v=1) noexcept
static const uint8_t KEY_EQUAL
cid_t SWC_CONST_FUNC get_meta_cid(KeySeq col_seq) noexcept
std::shared_ptr< Scanner > Ptr
void mngr_resolve_rgr_meta()
ReqBase::Ptr data_req_base
Comm::EndPoints data_endpoints
void print(std::ostream &out) const
constexpr SWC_CAN_INLINE bool is_last() noexcept
std::shared_ptr< ConnQueueReqBase > Ptr
SWC_CAN_INLINE void add_cached(bool err) const noexcept
SWC_CAN_INLINE std::string to_string(const BitFieldInt< T, SZ > &v)
void rgr_located_master(const ReqBase::Ptr &base, const Comm::Protocol::Rgr::Params::RangeLocateRsp &rsp)
static const uint8_t CURRENT_RANGE
SWC_CAN_INLINE client::Clients::Ptr & get_clients() noexcept
static SWC_CAN_INLINE void request(const Params::RgrGetReq ¶ms, const uint32_t timeout, DataArgsT &&... args)
SWC_CAN_INLINE bool valid()
void rgr_selected(const ReqBase::Ptr &req, Comm::Protocol::Rgr::Params::RangeQuerySelectRsp &rsp)
Condition::Comp compare(const Types::KeySeq seq, const Cell::Key &key, const Cell::Key &other) SWC_ATTRIBS((SWC_ATTRIB_O3))
#define SWC_SCANNER_REQ_DEBUG(msg)
SWC_CAN_INLINE void add(bool err) const noexcept