 |
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.
6 #ifndef swcdb_db_client_Clients_h
7 #define swcdb_db_client_Clients_h
35 namespace SWC {
namespace client {
39 class Clients :
public std::enable_shared_from_this<Clients> {
88 return shared_from_this();
94 [ptr=
shared()]() noexcept { ptr->brokers.on_cfg_update(); }
135 uint32_t timeout=300000) {
141 uint32_t timeout=300000) {
148 uint32_t timeout=300000) {
149 schemas.
get(err, patterns, _schemas, timeout);
155 uint32_t timeout=300000) {
188 const int64_t revision) {
190 cid, rid, range_begin, range_end, endpoints, revision);
203 cid, range_begin, range_end, rid, offset, is_end, endpoints, revision);
214 cid, key, rid, key_end, endpoints, revision);
300 return m_env->m_clients;
320 inline static std::shared_ptr<Clients>
m_env =
nullptr;
330 #ifdef SWC_IMPL_SOURCE
339 #endif // swcdb_db_client_Clients_h
SWC_CAN_INLINE void set_flags__schemas_via_default() noexcept
SWC_CAN_INLINE DB::Schema::Ptr get_schema(int &err, cid_t cid, uint32_t timeout=300000)
SWC_CAN_INLINE bool mngr_cache_get_write_master(const cid_t cid, const DB::Cell::Key &key, rid_t &rid, DB::Cell::Key &key_end, Comm::EndPoints &endpoints, int64_t &revision)
const Config::Property::Value_int32_g::Ptr cfg_recv_buff_sz
static SWC_CAN_INLINE client::Clients::Ptr & get() noexcept
const Config::Property::Value_int32_g::Ptr cfg_send_buff_sz
std::shared_ptr< Schema > Ptr
const Comm::client::ConnQueuesPtr queues
const Comm::client::ConnQueuesPtr queues
std::shared_ptr< ContextManager > Ptr
Comm::IoContextPtr io_ctx
SWC_CAN_INLINE DB::SchemasVec get_schema(int &err, const DB::Schemas::SelectorPatterns &patterns, uint32_t timeout=300000)
std::shared_ptr< IoContext > IoContextPtr
SWC_CAN_INLINE Comm::IoContextPtr & get_io() noexcept
const Config::Property::Value_uint8_g::Ptr cfg_send_ahead
const Config::Property::Value_int32_g::Ptr cfg_send_timeout
std::shared_ptr< ContextBroker > Ptr
SWC_CAN_INLINE Comm::client::Host::Ptr get_bkr_queue(const Comm::EndPoints &endpoints)
void remove(const cid_t cid, const rid_t rid)
const Config::Property::Value_strings_g::Ptr cfg_hosts
SWC_CAN_INLINE void mngr_cache_set_master(const cid_t cid, const rid_t rid, const DB::Cell::Key &range_begin, const DB::Cell::Key &range_end, const Comm::EndPoints &endpoints, const int64_t revision)
SWC_CAN_INLINE void get_mngr(const uint8_t &role, Comm::EndPoints &endpoints)
void set_cb_on_chg(OnChg_t &&cb)
void set(const cid_t cid, const rid_t rid, const Comm::EndPoints &endpoints)
SWC_CAN_INLINE void remove_mngr(const Comm::EndPoints &endpoints)
static void init(const client::Clients::Ptr &clients)
std::shared_ptr< Clients > ClientsPtr
const Comm::client::ConnQueuesPtr queues
std::shared_ptr< Host > Ptr
constexpr SWC_CAN_INLINE void store(T v) noexcept
SWC_CAN_INLINE Comm::client::Host::Ptr get_rgr_queue(const Comm::EndPoints &endpoints)
const Config::Property::Value_int32_g::Ptr cfg_recv_timeout
Clients & operator=(const Clients &)=delete
SWC_CAN_INLINE Comm::IoContextPtr get_bkr_io()
The SWC-DB C++ namespace 'SWC'.
SWC_CAN_INLINE bool rgr_cache_get(const cid_t cid, const rid_t rid, Comm::EndPoints &endpoints)
SWC_CAN_INLINE void rgr_cache_set(const cid_t cid, const rid_t rid, const Comm::EndPoints &endpoints)
Clients(const client::Clients::Ptr &clients) noexcept
SWC_CAN_INLINE void get_schema(int &err, const DB::Schemas::SelectorPatterns &patterns, DB::SchemasVec &_schemas, uint32_t timeout=300000)
MasterRangesCache master_ranges_cache
SWC_CAN_INLINE void rgr_cache_remove(const cid_t cid, const rid_t rid)
SWC_CAN_INLINE void set(const cid_t cid, const rid_t rid, const DB::Cell::Key &range_begin, const DB::Cell::Key &range_end, const Comm::EndPoints &endpoints, const int64_t revision)
client::Clients::Ptr m_clients
SWC_CAN_INLINE bool mngr_cache_get_read_master(const cid_t cid, const DB::Cell::Key &range_begin, const DB::Cell::Key &range_end, rid_t &rid, DB::Cell::Key &offset, bool &is_end, Comm::EndPoints &endpoints, int64_t &revision)
SWC_CAN_INLINE bool get_read(const cid_t cid, const DB::Cell::Key &range_begin, const DB::Cell::Key &range_end, rid_t &rid, DB::Cell::Key &offset, bool &is_end, Comm::EndPoints &endpoints, int64_t &revision)
SWC_CAN_INLINE Comm::client::Host::Ptr get_mngr_queue(const Comm::EndPoints &endpoints)
SWC_CAN_INLINE void get_mngr(const cid_t &cid, Comm::EndPoints &endpoints)
SWC_CAN_INLINE void remove(const cid_t cid, const rid_t rid) noexcept
DB::Schema::Ptr get(int &err, cid_t cid, uint32_t timeout=300000)
static std::shared_ptr< Clients > m_env
SWC_CAN_INLINE bool stopping() const noexcept
static void reset() noexcept
SWC_CAN_INLINE DB::Schema::Ptr get_schema(int &err, const std::string &name, uint32_t timeout=300000)
SWC_CAN_INLINE void mngr_cache_remove_master(const cid_t cid, const rid_t rid)
static Ptr make(const Config::Settings &settings, const Comm::IoContextPtr &io_ctx, const ContextManager::Ptr &mngr_ctx, const ContextRanger::Ptr &rgr_ctx, const ContextBroker::Ptr &bkr_ctx)
const Mngr::Groups::Ptr groups
Clients(const Clients &)=delete
SWC_CAN_INLINE bool get_write(const cid_t cid, const DB::Cell::Key &key, rid_t &rid, DB::Cell::Key &key_end, Comm::EndPoints &endpoints, int64_t &revision)
const Config::Property::Value_int32_g::Ptr cfg_send_timeout_ratio
bool get(const cid_t cid, const rid_t rid, Comm::EndPoints &endpoints)
SWC_CAN_INLINE Comm::IoContextPtr get_rgr_io()
Clients(const Config::Settings &settings, const Comm::IoContextPtr &io_ctx, const ContextManager::Ptr &mngr_ctx, const ContextRanger::Ptr &rgr_ctx, const ContextBroker::Ptr &bkr_ctx)
SWC_CAN_INLINE void set_flags(uint8_t _flags) noexcept
SWC_CAN_INLINE Comm::IoContextPtr get_mngr_io()
SWC_CAN_INLINE bool has_brokers() noexcept
const Config::Property::Value_uint8_g::Ptr cfg_recv_ahead
Core::Atomic< uint8_t > flags
static SWC_CAN_INLINE const Clients & ref() noexcept