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::Brokers Class Reference

#include <swcdb/db/client/service/bkr/Brokers.h>

+ Collaboration diagram for SWC::client::Brokers:

Classes

struct  BrokerIdx
 

Public Types

typedef Core::Vector< Comm::EndPointsBrokersEndPoints
 

Public Member Functions

SWC_CAN_INLINE Brokers () noexcept
 
 Brokers (const Config::Settings &settings, Comm::IoContextPtr ioctx, const ContextBroker::Ptr &bkr_ctx)
 
 Brokers (const Brokers &)=delete
 
Brokersoperator= (const Brokers &)=delete
 
 ~Brokers () noexcept
 
void on_cfg_update () noexcept
 
size_t size () noexcept
 
bool get (BrokerIdx &idx, Comm::EndPoints &endpoints)
 
bool has_endpoints () noexcept
 
void set (BrokersEndPoints &&endpoints)
 
void set (const BrokersEndPoints &endpoints)
 
bool put (const Comm::client::ConnQueue::ReqBase::Ptr &req, BrokerIdx &idx)
 

Public Attributes

const Comm::client::ConnQueuesPtr queues
 
const Config::Property::Value_strings_g::Ptr cfg_hosts
 
const uint16_t cfg_port
 

Private Attributes

Core::MutexSptd m_mutex
 
BrokersEndPoints m_brokers
 

Detailed Description

Definition at line 18 of file Brokers.h.

Member Typedef Documentation

◆ BrokersEndPoints

Constructor & Destructor Documentation

◆ Brokers() [1/3]

SWC_CAN_INLINE SWC::client::Brokers::Brokers ( )
inlinenoexcept

Definition at line 31 of file Brokers.h.

◆ Brokers() [2/3]

SWC::client::Brokers::Brokers ( const Config::Settings settings,
Comm::IoContextPtr  ioctx,
const ContextBroker::Ptr bkr_ctx 
)

Definition at line 12 of file Brokers.cc.

References on_cfg_update().

+ Here is the call graph for this function:

◆ Brokers() [3/3]

SWC::client::Brokers::Brokers ( const Brokers )
delete

◆ ~Brokers()

SWC::client::Brokers::~Brokers ( )
inlinenoexcept

Definition at line 44 of file Brokers.h.

Member Function Documentation

◆ get()

bool SWC::client::Brokers::get ( Brokers::BrokerIdx idx,
Comm::EndPoints endpoints 
)

Definition at line 103 of file Brokers.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), m_brokers, m_mutex, SWC::client::Brokers::BrokerIdx::pos, and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().

+ Here is the call graph for this function:

◆ has_endpoints()

bool SWC::client::Brokers::has_endpoints ( )
noexcept

Definition at line 112 of file Brokers.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Core::Vector< T, SizeT, GROW_SZ >::front(), m_brokers, and m_mutex.

+ Here is the call graph for this function:

◆ on_cfg_update()

void SWC::client::Brokers::on_cfg_update ( )
noexcept

Definition at line 40 of file Brokers.cc.

References cfg_hosts, cfg_port, SWC::Core::Vector< T, SizeT, GROW_SZ >::emplace_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Config::Property::from_string(), SWC::Config::Property::Value_strings_g::get(), SWC::Comm::Resolver::get_endpoints(), SWC::Comm::Resolver::is_ipv4_address(), SWC::Comm::Resolver::is_ipv6_address(), SWC::LOG_DEBUG, SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), set(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), SWC_LOG_CURRENT_EXCEPTION, SWC_LOG_OSTREAM, and SWC_LOG_OUT.

Referenced by Brokers().

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

◆ operator=()

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

◆ put()

bool SWC::client::Brokers::put ( const Comm::client::ConnQueue::ReqBase::Ptr req,
Brokers::BrokerIdx idx 
)

Definition at line 127 of file Brokers.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::LOG_ERROR, m_brokers, m_mutex, SWC::client::Brokers::BrokerIdx::pos, queues, SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), and SWC_LOG.

+ Here is the call graph for this function:

◆ set() [1/2]

void SWC::client::Brokers::set ( BrokersEndPoints &&  endpoints)

Definition at line 117 of file Brokers.cc.

References m_brokers, and m_mutex.

Referenced by on_cfg_update().

+ Here is the caller graph for this function:

◆ set() [2/2]

void SWC::client::Brokers::set ( const BrokersEndPoints endpoints)

Definition at line 122 of file Brokers.cc.

References m_brokers, and m_mutex.

◆ size()

size_t SWC::client::Brokers::size ( )
noexcept

Definition at line 98 of file Brokers.cc.

References m_brokers, m_mutex, and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().

+ Here is the call graph for this function:

Member Data Documentation

◆ cfg_hosts

const Config::Property::Value_strings_g::Ptr SWC::client::Brokers::cfg_hosts

Definition at line 61 of file Brokers.h.

Referenced by SWC::client::Clients::init(), and on_cfg_update().

◆ cfg_port

const uint16_t SWC::client::Brokers::cfg_port

Definition at line 62 of file Brokers.h.

Referenced by on_cfg_update().

◆ m_brokers

BrokersEndPoints SWC::client::Brokers::m_brokers
private

Definition at line 66 of file Brokers.h.

Referenced by get(), has_endpoints(), put(), set(), and size().

◆ m_mutex

Core::MutexSptd SWC::client::Brokers::m_mutex
private

Definition at line 65 of file Brokers.h.

Referenced by get(), has_endpoints(), put(), set(), and size().

◆ queues


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