#include <swcdb/db/client/Schemas.h>
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 | |
Schemas & | operator= (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, SchemaData > | m_schemas |
Clients * | _clients |
Config::Property::Value_int32_g::Ptr | m_expiry_ms |
std::unordered_map< cid_t, Pending > | m_pending_cid |
std::unordered_map< std::string, Pending > | m_pending_name |
|
inlinenoexcept |
|
delete |
|
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().
|
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().
|
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().
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().
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().
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().
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().
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().
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().
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().
void SWC::client::Schemas::remove | ( | cid_t | cid | ) |
Definition at line 16 of file Schemas.cc.
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().
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().
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().
|
private |
Definition at line 99 of file Schemas.h.
Referenced by _request().
|
private |
Definition at line 100 of file Schemas.h.
Referenced by clear_expired(), and get().
|
private |
|
private |
|
private |