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::Schemas Class Referencefinal

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

+ Collaboration diagram for SWC::client::Schemas:

Classes

class  ColumnGetData
 
struct  Pending
 
struct  SchemaData
 

Public Member Functions

SWC_CAN_INLINE Schemas (Clients *a_clients, const Config::Property::Value_int32_g::Ptr expiry_ms) noexcept
 
 Schemas (const Schemas &)=delete
 
Schemasoperator= (const Schemas &)=delete
 
 ~Schemas () noexcept
 
void remove (cid_t cid)
 
void remove (const std::string &name)
 
void clear_expired ()
 
DB::Schema::Ptr get (int &err, cid_t cid, uint32_t timeout=300000)
 
DB::Schema::Ptr get (int &err, const std::string &name, uint32_t timeout=300000)
 
DB::Schema::Ptr get (cid_t cid)
 
DB::Schema::Ptr get (const std::string &name)
 
void get (int &err, const DB::Schemas::SelectorPatterns &patterns, DB::SchemasVec &schemas, uint32_t timeout=300000)
 
DB::SchemasVec get (int &err, const DB::Schemas::SelectorPatterns &patterns, uint32_t timeout=300000)
 
void set (const DB::Schema::Ptr &schema)
 
void set (const DB::SchemasVec &schemas)
 

Private Member Functions

Pending _request (cid_t cid, uint32_t timeout)
 
Pending _request (const std::string &name, uint32_t timeout)
 
void _request (int &err, const DB::Schemas::SelectorPatterns &patterns, DB::SchemasVec &schemas, uint32_t timeout)
 

Private Attributes

Core::MutexSptd m_mutex
 
std::unordered_map< cid_t, SchemaDatam_schemas
 
Clients_clients
 
Config::Property::Value_int32_g::Ptr m_expiry_ms
 
std::unordered_map< cid_t, Pendingm_pending_cid
 
std::unordered_map< std::string, Pendingm_pending_name
 

Detailed Description

Definition at line 17 of file Schemas.h.

Constructor & Destructor Documentation

◆ Schemas() [1/2]

SWC_CAN_INLINE SWC::client::Schemas::Schemas ( Clients a_clients,
const Config::Property::Value_int32_g::Ptr  expiry_ms 
)
inlinenoexcept

Definition at line 21 of file Schemas.h.

◆ Schemas() [2/2]

SWC::client::Schemas::Schemas ( const Schemas )
delete

◆ ~Schemas()

SWC::client::Schemas::~Schemas ( )
inlinenoexcept

Definition at line 32 of file Schemas.h.

Member Function Documentation

◆ _request() [1/3]

Schemas::Pending SWC::client::Schemas::_request ( cid_t  cid,
uint32_t  timeout 
)
private

Definition at line 224 of file Schemas.cc.

References _clients, SWC::FS::BROKER, SWC::client::Clients::flags, SWC::Comm::Protocol::Bkr::Req::ColumnGet< DataT >::make(), SWC::Comm::Protocol::Mngr::Req::ColumnGet< DataT >::make(), and SWC::client::Clients::shared().

Referenced by get().

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

◆ _request() [2/3]

Schemas::Pending SWC::client::Schemas::_request ( const std::string &  name,
uint32_t  timeout 
)
private

Definition at line 253 of file Schemas.cc.

References _clients, SWC::FS::BROKER, SWC::client::Clients::flags, SWC::Comm::Protocol::Bkr::Req::ColumnGet< DataT >::make(), SWC::Comm::Protocol::Mngr::Req::ColumnGet< DataT >::make(), and SWC::client::Clients::shared().

+ Here is the call graph for this function:

◆ _request() [3/3]

void SWC::client::Schemas::_request ( int &  err,
const DB::Schemas::SelectorPatterns patterns,
DB::SchemasVec schemas,
uint32_t  timeout 
)
private

Definition at line 281 of file Schemas.cc.

References _clients, SWC::FS::BROKER, SWC::client::Clients::flags, SWC::Comm::Protocol::Bkr::Req::ColumnList_Sync::request(), SWC::Comm::Protocol::Mngr::Req::ColumnList_Sync::request(), and SWC::client::Clients::shared().

+ Here is the call graph for this function:

◆ clear_expired()

void SWC::client::Schemas::clear_expired ( )

Definition at line 33 of file Schemas.cc.

References SWC::Config::Property::Value_int32_g::get(), m_expiry_ms, m_mutex, m_schemas, and SWC::Time::now_ms().

+ Here is the call graph for this function:

◆ get() [1/6]

DB::Schema::Ptr SWC::client::Schemas::get ( cid_t  cid)

Definition at line 163 of file Schemas.cc.

References SWC::Config::Property::Value_int32_g::get(), m_expiry_ms, m_mutex, m_schemas, and SWC::Time::now_ms().

+ Here is the call graph for this function:

◆ get() [2/6]

DB::Schema::Ptr SWC::client::Schemas::get ( const std::string &  name)

Definition at line 171 of file Schemas.cc.

References data, SWC::Config::Property::Value_int32_g::get(), m_expiry_ms, m_mutex, m_schemas, SWC::Time::now_ms(), and SWC::Condition::str_eq().

+ Here is the call graph for this function:

◆ get() [3/6]

DB::Schema::Ptr SWC::client::Schemas::get ( int &  err,
cid_t  cid,
uint32_t  timeout = 300000 
)

Definition at line 98 of file Schemas.cc.

References _request(), SWC::Error::COLUMN_SCHEMA_MISSING, SWC::client::Schemas::Pending::datap, SWC::Config::Property::Value_int32_g::get(), m_expiry_ms, m_mutex, m_pending_cid, m_schemas, SWC::Time::now_ms(), SWC::client::Schemas::Pending::req, and SWC::client::Schemas::ColumnGetData::wait().

Referenced by get(), and SWC::client::Clients::get_schema().

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

◆ get() [4/6]

void SWC::client::Schemas::get ( int &  err,
const DB::Schemas::SelectorPatterns patterns,
DB::SchemasVec schemas,
uint32_t  timeout = 300000 
)

Definition at line 184 of file Schemas.cc.

References _request(), SWC::Error::COLUMN_SCHEMA_MISSING, SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), m_mutex, m_schemas, and SWC::Time::now_ms().

+ Here is the call graph for this function:

◆ get() [5/6]

DB::SchemasVec SWC::client::Schemas::get ( int &  err,
const DB::Schemas::SelectorPatterns patterns,
uint32_t  timeout = 300000 
)

Definition at line 201 of file Schemas.cc.

References get().

+ Here is the call graph for this function:

◆ get() [6/6]

DB::Schema::Ptr SWC::client::Schemas::get ( int &  err,
const std::string &  name,
uint32_t  timeout = 300000 
)

Definition at line 130 of file Schemas.cc.

References _request(), SWC::Error::COLUMN_SCHEMA_MISSING, data, SWC::client::Schemas::Pending::datap, SWC::Config::Property::Value_int32_g::get(), m_expiry_ms, m_mutex, m_pending_name, m_schemas, SWC::Time::now_ms(), SWC::client::Schemas::Pending::req, SWC::Condition::str_eq(), and SWC::client::Schemas::ColumnGetData::wait().

+ Here is the call graph for this function:

◆ operator=()

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

◆ remove() [1/2]

void SWC::client::Schemas::remove ( cid_t  cid)

Definition at line 16 of file Schemas.cc.

References m_mutex, and m_schemas.

◆ remove() [2/2]

void SWC::client::Schemas::remove ( const std::string &  name)

Definition at line 23 of file Schemas.cc.

References m_mutex, m_schemas, and SWC::Condition::str_eq().

+ Here is the call graph for this function:

◆ set() [1/2]

void SWC::client::Schemas::set ( const DB::Schema::Ptr schema)

Definition at line 208 of file Schemas.cc.

References m_mutex, m_schemas, and SWC::Time::now_ms().

+ Here is the call graph for this function:

◆ set() [2/2]

void SWC::client::Schemas::set ( const DB::SchemasVec schemas)

Definition at line 214 of file Schemas.cc.

References m_mutex, m_schemas, and SWC::Time::now_ms().

+ Here is the call graph for this function:

Member Data Documentation

◆ _clients

Clients* SWC::client::Schemas::_clients
private

Definition at line 99 of file Schemas.h.

Referenced by _request().

◆ m_expiry_ms

Config::Property::Value_int32_g::Ptr SWC::client::Schemas::m_expiry_ms
private

Definition at line 100 of file Schemas.h.

Referenced by clear_expired(), and get().

◆ m_mutex

Core::MutexSptd SWC::client::Schemas::m_mutex
private

Definition at line 97 of file Schemas.h.

Referenced by clear_expired(), get(), remove(), and set().

◆ m_pending_cid

std::unordered_map<cid_t, Pending> SWC::client::Schemas::m_pending_cid
private

Definition at line 101 of file Schemas.h.

Referenced by get().

◆ m_pending_name

std::unordered_map<std::string, Pending> SWC::client::Schemas::m_pending_name
private

Definition at line 102 of file Schemas.h.

Referenced by get().

◆ m_schemas

std::unordered_map<cid_t, SchemaData> SWC::client::Schemas::m_schemas
private

Definition at line 98 of file Schemas.h.

Referenced by clear_expired(), get(), remove(), and set().


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