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::client::Clients Class Reference

#include <swcdb/db/client/Clients.h>

+ Inheritance diagram for SWC::client::Clients:
+ Collaboration diagram for SWC::client::Clients:

Public Types

enum  Flag : uint8_t {
  DEFAULT = 0x01,
  BROKER = 0x02,
  SCHEMA = 0x04
}
 
using Ptr = ClientsPtr
 

Public Member Functions

 Clients (const Clients &)=delete
 
Clientsoperator= (const Clients &)=delete
 
 ~Clients () noexcept
 
Ptr shared ()
 
Ptr init ()
 
void stop_services ()
 
void stop_io ()
 
void stop ()
 
SWC_CAN_INLINE bool stopping () const noexcept
 
SWC_CAN_INLINE void set_flags (uint8_t _flags) noexcept
 
SWC_CAN_INLINE void set_flags__schemas_via_default () noexcept
 
SWC_CAN_INLINE Comm::IoContextPtrget_io () noexcept
 
SWC_CAN_INLINE bool has_brokers () noexcept
 
SWC_CAN_INLINE DB::Schema::Ptr get_schema (int &err, cid_t cid, uint32_t timeout=300000)
 
SWC_CAN_INLINE DB::Schema::Ptr get_schema (int &err, const std::string &name, uint32_t timeout=300000)
 
SWC_CAN_INLINE void get_schema (int &err, const DB::Schemas::SelectorPatterns &patterns, DB::SchemasVec &_schemas, uint32_t timeout=300000)
 
SWC_CAN_INLINE DB::SchemasVec get_schema (int &err, const DB::Schemas::SelectorPatterns &patterns, uint32_t timeout=300000)
 
SWC_CAN_INLINE void rgr_cache_remove (const cid_t cid, const rid_t rid)
 
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)
 
SWC_CAN_INLINE void mngr_cache_remove_master (const cid_t cid, const rid_t rid)
 
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 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 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)
 
SWC_CAN_INLINE Comm::IoContextPtr get_mngr_io ()
 
SWC_CAN_INLINE Comm::client::Host::Ptr get_mngr_queue (const Comm::EndPoints &endpoints)
 
SWC_CAN_INLINE Comm::IoContextPtr get_rgr_io ()
 
SWC_CAN_INLINE Comm::client::Host::Ptr get_rgr_queue (const Comm::EndPoints &endpoints)
 
SWC_CAN_INLINE Comm::IoContextPtr get_bkr_io ()
 
SWC_CAN_INLINE Comm::client::Host::Ptr get_bkr_queue (const Comm::EndPoints &endpoints)
 
SWC_CAN_INLINE void get_mngr (const cid_t &cid, Comm::EndPoints &endpoints)
 
SWC_CAN_INLINE void get_mngr (const uint8_t &role, Comm::EndPoints &endpoints)
 
SWC_CAN_INLINE void remove_mngr (const Comm::EndPoints &endpoints)
 

Static Public Member Functions

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)
 
static Ptr make (const Config::Settings &settings, const Comm::IoContextPtr &io_ctx, const ContextManager::Ptr &mngr_ctx, const ContextRanger::Ptr &rgr_ctx)
 
static Ptr make (const Config::Settings &settings, const Comm::IoContextPtr &io_ctx, const ContextBroker::Ptr &bkr_ctx)
 

Public Attributes

Core::AtomicBool running
 
Core::Atomic< uint8_t > flags
 
const Config::Property::Value_int32_g::Ptr cfg_send_buff_sz
 
const Config::Property::Value_uint8_g::Ptr cfg_send_ahead
 
const Config::Property::Value_int32_g::Ptr cfg_send_timeout
 
const Config::Property::Value_int32_g::Ptr cfg_send_timeout_ratio
 
const Config::Property::Value_int32_g::Ptr cfg_recv_buff_sz
 
const Config::Property::Value_uint8_g::Ptr cfg_recv_ahead
 
const Config::Property::Value_int32_g::Ptr cfg_recv_timeout
 
Comm::IoContextPtr io_ctx
 
Schemas schemas
 
Managers managers
 
Rangers rangers
 
Brokers brokers
 

Protected Member Functions

 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)
 
 Clients (const Config::Settings &settings, const Comm::IoContextPtr &io_ctx, const ContextManager::Ptr &mngr_ctx, const ContextRanger::Ptr &rgr_ctx)
 
 Clients (const Config::Settings &settings, const Comm::IoContextPtr &io_ctx, const ContextBroker::Ptr &bkr_ctx)
 

Detailed Description

Definition at line 39 of file Clients.h.

Member Typedef Documentation

◆ Ptr

Definition at line 58 of file Clients.h.

Member Enumeration Documentation

◆ Flag

Enumerator
DEFAULT 
BROKER 
SCHEMA 

Definition at line 60 of file Clients.h.

Constructor & Destructor Documentation

◆ Clients() [1/4]

SWC::client::Clients::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 
)
protected

Definition at line 42 of file Clients.cc.

Referenced by make().

+ Here is the caller graph for this function:

◆ Clients() [2/4]

SWC::client::Clients::Clients ( const Config::Settings settings,
const Comm::IoContextPtr io_ctx,
const ContextManager::Ptr mngr_ctx,
const ContextRanger::Ptr rgr_ctx 
)
protected

Definition at line 81 of file Clients.cc.

◆ Clients() [3/4]

SWC::client::Clients::Clients ( const Config::Settings settings,
const Comm::IoContextPtr io_ctx,
const ContextBroker::Ptr bkr_ctx 
)
protected

Definition at line 119 of file Clients.cc.

◆ Clients() [4/4]

SWC::client::Clients::Clients ( const Clients )
delete

◆ ~Clients()

SWC::client::Clients::~Clients ( )
noexcept

Definition at line 156 of file Clients.cc.

Member Function Documentation

◆ get_bkr_io()

SWC_CAN_INLINE Comm::IoContextPtr SWC::client::Clients::get_bkr_io ( )
inline

Definition at line 241 of file Clients.h.

References brokers, and SWC::client::Brokers::queues.

◆ get_bkr_queue()

SWC_CAN_INLINE Comm::client::Host::Ptr SWC::client::Clients::get_bkr_queue ( const Comm::EndPoints endpoints)
inline

Definition at line 246 of file Clients.h.

References brokers, and SWC::client::Brokers::queues.

◆ get_io()

SWC_CAN_INLINE Comm::IoContextPtr& SWC::client::Clients::get_io ( )
inlinenoexcept

Definition at line 124 of file Clients.h.

References io_ctx.

◆ get_mngr() [1/2]

SWC_CAN_INLINE void SWC::client::Clients::get_mngr ( const cid_t cid,
Comm::EndPoints endpoints 
)
inline

Definition at line 251 of file Clients.h.

References SWC::client::Managers::groups, and managers.

◆ get_mngr() [2/2]

SWC_CAN_INLINE void SWC::client::Clients::get_mngr ( const uint8_t &  role,
Comm::EndPoints endpoints 
)
inline

Definition at line 256 of file Clients.h.

References SWC::client::Managers::groups, and managers.

◆ get_mngr_io()

SWC_CAN_INLINE Comm::IoContextPtr SWC::client::Clients::get_mngr_io ( )
inline

Definition at line 219 of file Clients.h.

References managers, and SWC::client::Managers::queues.

◆ get_mngr_queue()

SWC_CAN_INLINE Comm::client::Host::Ptr SWC::client::Clients::get_mngr_queue ( const Comm::EndPoints endpoints)
inline

Definition at line 224 of file Clients.h.

References managers, and SWC::client::Managers::queues.

◆ get_rgr_io()

SWC_CAN_INLINE Comm::IoContextPtr SWC::client::Clients::get_rgr_io ( )
inline

Definition at line 230 of file Clients.h.

References SWC::client::Rangers::queues, and rangers.

◆ get_rgr_queue()

SWC_CAN_INLINE Comm::client::Host::Ptr SWC::client::Clients::get_rgr_queue ( const Comm::EndPoints endpoints)
inline

Definition at line 235 of file Clients.h.

References SWC::client::Rangers::queues, and rangers.

◆ get_schema() [1/4]

SWC_CAN_INLINE DB::Schema::Ptr SWC::client::Clients::get_schema ( int &  err,
cid_t  cid,
uint32_t  timeout = 300000 
)
inline

Definition at line 134 of file Clients.h.

References SWC::client::Schemas::get(), and schemas.

+ Here is the call graph for this function:

◆ get_schema() [2/4]

SWC_CAN_INLINE void SWC::client::Clients::get_schema ( int &  err,
const DB::Schemas::SelectorPatterns patterns,
DB::SchemasVec _schemas,
uint32_t  timeout = 300000 
)
inline

Definition at line 146 of file Clients.h.

References SWC::client::Schemas::get(), and schemas.

+ Here is the call graph for this function:

◆ get_schema() [3/4]

SWC_CAN_INLINE DB::SchemasVec SWC::client::Clients::get_schema ( int &  err,
const DB::Schemas::SelectorPatterns patterns,
uint32_t  timeout = 300000 
)
inline

Definition at line 154 of file Clients.h.

References SWC::client::Schemas::get(), and schemas.

+ Here is the call graph for this function:

◆ get_schema() [4/4]

SWC_CAN_INLINE DB::Schema::Ptr SWC::client::Clients::get_schema ( int &  err,
const std::string &  name,
uint32_t  timeout = 300000 
)
inline

Definition at line 140 of file Clients.h.

References SWC::client::Schemas::get(), and schemas.

+ Here is the call graph for this function:

◆ has_brokers()

SWC_CAN_INLINE bool SWC::client::Clients::has_brokers ( )
inlinenoexcept

Definition at line 129 of file Clients.h.

References brokers, and SWC::client::Brokers::queues.

Referenced by init().

+ Here is the caller graph for this function:

◆ init()

Ptr SWC::client::Clients::init ( )
inline

Definition at line 91 of file Clients.h.

References brokers, SWC::client::Brokers::cfg_hosts, has_brokers(), SWC::Config::Property::Value_strings_g::set_cb_on_chg(), and shared().

+ Here is the call graph for this function:

◆ make() [1/3]

Clients::Ptr SWC::client::Clients::make ( const Config::Settings settings,
const Comm::IoContextPtr io_ctx,
const ContextBroker::Ptr bkr_ctx 
)
static

Definition at line 32 of file Clients.cc.

References Clients(), and io_ctx.

+ Here is the call graph for this function:

◆ make() [2/3]

Clients::Ptr SWC::client::Clients::make ( const Config::Settings settings,
const Comm::IoContextPtr io_ctx,
const ContextManager::Ptr mngr_ctx,
const ContextRanger::Ptr rgr_ctx 
)
static

Definition at line 23 of file Clients.cc.

References Clients(), and io_ctx.

+ Here is the call graph for this function:

◆ make() [3/3]

Clients::Ptr SWC::client::Clients::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 
)
static

Definition at line 13 of file Clients.cc.

References Clients(), and io_ctx.

Referenced by SWC::FsBroker::AppContext::AppContext(), SWC::Manager::AppContext::AppContext(), SWC::ThriftBroker::AppContext::AppContext(), SWC::Broker::AppContext::make(), SWC::Ranger::AppContext::make(), and run().

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

◆ mngr_cache_get_read_master()

SWC_CAN_INLINE bool SWC::client::Clients::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 
)
inline

Definition at line 194 of file Clients.h.

References SWC::client::Managers::MasterRangesCache::get_read(), managers, and SWC::client::Managers::master_ranges_cache.

+ Here is the call graph for this function:

◆ mngr_cache_get_write_master()

SWC_CAN_INLINE bool SWC::client::Clients::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 
)
inline

Definition at line 207 of file Clients.h.

References SWC::client::Managers::MasterRangesCache::get_write(), managers, and SWC::client::Managers::master_ranges_cache.

+ Here is the call graph for this function:

◆ mngr_cache_remove_master()

SWC_CAN_INLINE void SWC::client::Clients::mngr_cache_remove_master ( const cid_t  cid,
const rid_t  rid 
)
inline

Definition at line 179 of file Clients.h.

References managers, SWC::client::Managers::master_ranges_cache, and SWC::client::Managers::MasterRangesCache::remove().

+ Here is the call graph for this function:

◆ mngr_cache_set_master()

SWC_CAN_INLINE void SWC::client::Clients::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 
)
inline

Definition at line 184 of file Clients.h.

References managers, SWC::client::Managers::master_ranges_cache, and SWC::client::Managers::MasterRangesCache::set().

+ Here is the call graph for this function:

◆ operator=()

Clients& SWC::client::Clients::operator= ( const Clients )
delete

◆ remove_mngr()

SWC_CAN_INLINE void SWC::client::Clients::remove_mngr ( const Comm::EndPoints endpoints)
inline

Definition at line 261 of file Clients.h.

References SWC::client::Managers::groups, and managers.

◆ rgr_cache_get()

SWC_CAN_INLINE bool SWC::client::Clients::rgr_cache_get ( const cid_t  cid,
const rid_t  rid,
Comm::EndPoints endpoints 
)
inline

Definition at line 166 of file Clients.h.

References SWC::client::Rangers::cache, SWC::client::CachedRangers::get(), and rangers.

+ Here is the call graph for this function:

◆ rgr_cache_remove()

SWC_CAN_INLINE void SWC::client::Clients::rgr_cache_remove ( const cid_t  cid,
const rid_t  rid 
)
inline

Definition at line 161 of file Clients.h.

References SWC::client::Rangers::cache, rangers, and SWC::client::CachedRangers::remove().

+ Here is the call graph for this function:

◆ rgr_cache_set()

SWC_CAN_INLINE void SWC::client::Clients::rgr_cache_set ( const cid_t  cid,
const rid_t  rid,
const Comm::EndPoints endpoints 
)
inline

Definition at line 172 of file Clients.h.

References SWC::client::Rangers::cache, rangers, and SWC::client::CachedRangers::set().

+ Here is the call graph for this function:

◆ set_flags()

SWC_CAN_INLINE void SWC::client::Clients::set_flags ( uint8_t  _flags)
inlinenoexcept

Definition at line 114 of file Clients.h.

References flags, and SWC::Core::AtomicBase< T, OrderT >::store().

Referenced by set_flags__schemas_via_default().

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

◆ set_flags__schemas_via_default()

SWC_CAN_INLINE void SWC::client::Clients::set_flags__schemas_via_default ( )
inlinenoexcept

Definition at line 119 of file Clients.h.

References SWC::FS::BROKER, and set_flags().

+ Here is the call graph for this function:

◆ shared()

Ptr SWC::client::Clients::shared ( )
inline

Definition at line 87 of file Clients.h.

Referenced by SWC::client::Schemas::_request(), and init().

+ Here is the caller graph for this function:

◆ stop()

void SWC::client::Clients::stop ( )

Definition at line 169 of file Clients.cc.

References stop_io(), and stop_services().

+ Here is the call graph for this function:

◆ stop_io()

void SWC::client::Clients::stop_io ( )
inline

Definition at line 102 of file Clients.h.

References io_ctx.

Referenced by stop().

+ Here is the caller graph for this function:

◆ stop_services()

void SWC::client::Clients::stop_services ( )

Definition at line 158 of file Clients.cc.

References brokers, managers, SWC::client::Brokers::queues, SWC::client::Managers::queues, SWC::client::Rangers::queues, rangers, running, and SWC::Core::AtomicBase< T, OrderT >::store().

Referenced by stop().

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

◆ stopping()

SWC_CAN_INLINE bool SWC::client::Clients::stopping ( ) const
inlinenoexcept

Definition at line 109 of file Clients.h.

References running.

Member Data Documentation

◆ brokers

Brokers SWC::client::Clients::brokers

Definition at line 282 of file Clients.h.

Referenced by get_bkr_io(), get_bkr_queue(), has_brokers(), init(), and stop_services().

◆ cfg_recv_ahead

const Config::Property::Value_uint8_g::Ptr SWC::client::Clients::cfg_recv_ahead

Definition at line 275 of file Clients.h.

◆ cfg_recv_buff_sz

const Config::Property::Value_int32_g::Ptr SWC::client::Clients::cfg_recv_buff_sz

Definition at line 274 of file Clients.h.

◆ cfg_recv_timeout

const Config::Property::Value_int32_g::Ptr SWC::client::Clients::cfg_recv_timeout

Definition at line 276 of file Clients.h.

◆ cfg_send_ahead

const Config::Property::Value_uint8_g::Ptr SWC::client::Clients::cfg_send_ahead

Definition at line 270 of file Clients.h.

◆ cfg_send_buff_sz

const Config::Property::Value_int32_g::Ptr SWC::client::Clients::cfg_send_buff_sz

Definition at line 269 of file Clients.h.

◆ cfg_send_timeout

const Config::Property::Value_int32_g::Ptr SWC::client::Clients::cfg_send_timeout

Definition at line 271 of file Clients.h.

◆ cfg_send_timeout_ratio

const Config::Property::Value_int32_g::Ptr SWC::client::Clients::cfg_send_timeout_ratio

Definition at line 272 of file Clients.h.

◆ flags

Core::Atomic<uint8_t> SWC::client::Clients::flags

Definition at line 267 of file Clients.h.

Referenced by SWC::client::Schemas::_request(), and set_flags().

◆ io_ctx

Comm::IoContextPtr SWC::client::Clients::io_ctx

Definition at line 278 of file Clients.h.

Referenced by get_io(), make(), and stop_io().

◆ managers

◆ rangers

Rangers SWC::client::Clients::rangers

◆ running

Core::AtomicBool SWC::client::Clients::running

Definition at line 266 of file Clients.h.

Referenced by stop_services(), and stopping().

◆ schemas

Schemas SWC::client::Clients::schemas

Definition at line 279 of file Clients.h.

Referenced by get_schema().


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