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::Comm::Protocol::Mngr::Req::MngrActive Class Reference

#include <swcdb/db/Protocol/Mngr/req/MngrActive.h>

+ Inheritance diagram for SWC::Comm::Protocol::Mngr::Req::MngrActive:
+ Collaboration diagram for SWC::Comm::Protocol::Mngr::Req::MngrActive:

Public Types

typedef std::shared_ptr< MngrActivePtr
 
- Public Types inherited from SWC::Comm::client::ConnQueueReqBase
typedef std::shared_ptr< ConnQueueReqBasePtr
 
- Public Types inherited from SWC::Comm::DispatchHandler
typedef std::shared_ptr< DispatchHandlerPtr
 

Public Member Functions

SWC_CAN_INLINE MngrActive (const SWC::client::Clients::Ptr &a_clients, const uint8_t &a_role, const cid_t &a_cid, const DispatchHandler::Ptr &a_hdlr, uint32_t a_timeout_ms)
 
virtual ~MngrActive () noexcept
 
void run_within (uint32_t t_ms=1000)
 
void handle_no_conn () override
 
bool run () override
 
void handle (ConnHandlerPtr conn, const Event::Ptr &ev) override
 
- Public Member Functions inherited from SWC::Comm::client::ConnQueueReqBase
SWC_CAN_INLINE ConnQueueReqBase (Buffers::Ptr &&a_cbp) noexcept
 
SWC_CAN_INLINE ConnQueueReqBase (Buffers::Ptr &&a_cbp, const ConnQueuePtr &a_queue) noexcept
 
SWC_CAN_INLINE Ptr req () noexcept
 
virtual bool insistent () noexcept
 
void request_again ()
 
void print (std::ostream &out)
 
- Public Member Functions inherited from SWC::Comm::DispatchHandler
virtual bool valid ()
 

Static Public Member Functions

static SWC_CAN_INLINE Ptr make (const SWC::client::Clients::Ptr &clients, const cid_t &a_cid, const DispatchHandler::Ptr &hdlr, uint32_t timeout_ms=60000)
 
static SWC_CAN_INLINE Ptr make (const SWC::client::Clients::Ptr &clients, const uint8_t &a_role, const DispatchHandler::Ptr &hdlr, uint32_t timeout_ms=60000)
 

Protected Attributes

const uint32_t timeout_ms
 

Private Attributes

SWC::client::Clients::Ptr clients
 
const uint8_t role
 
const cid_t cid
 
DispatchHandler::Ptr hdlr
 
size_t nxt
 
SWC::client::Mngr::Hosts hosts
 
SWC::client::Mngr::Groups::GroupHost group_host
 
asio::high_resolution_timer timer
 

Additional Inherited Members

- Public Attributes inherited from SWC::Comm::client::ConnQueueReqBase
Buffers::Ptr cbp
 
ConnQueuePtr queue
 
- Protected Member Functions inherited from SWC::Comm::client::ConnQueueReqBase
virtual ~ConnQueueReqBase () noexcept
 
- Protected Member Functions inherited from SWC::Comm::DispatchHandler
virtual ~DispatchHandler () noexcept
 

Detailed Description

Definition at line 20 of file MngrActive.h.

Member Typedef Documentation

◆ Ptr

Definition at line 22 of file MngrActive.h.

Constructor & Destructor Documentation

◆ MngrActive()

SWC_CAN_INLINE SWC::Comm::Protocol::Mngr::Req::MngrActive::MngrActive ( const SWC::client::Clients::Ptr a_clients,
const uint8_t &  a_role,
const cid_t a_cid,
const DispatchHandler::Ptr a_hdlr,
uint32_t  a_timeout_ms 
)
inline

Definition at line 41 of file MngrActive.h.

Referenced by make().

+ Here is the caller graph for this function:

◆ ~MngrActive()

virtual SWC::Comm::Protocol::Mngr::Req::MngrActive::~MngrActive ( )
inlinevirtualnoexcept

Definition at line 58 of file MngrActive.h.

Member Function Documentation

◆ handle()

void SWC::Comm::Protocol::Mngr::Req::MngrActive::handle ( ConnHandlerPtr  conn,
const Event::Ptr ev 
)
overridevirtual

Implements SWC::Comm::DispatchHandler.

Definition at line 77 of file MngrActive.cc.

References clients, SWC::Comm::Serializable::decode(), SWC::client::Mngr::Groups::GroupHost::endpoints, SWC::Comm::Protocol::Mngr::Params::MngrActiveRsp::endpoints, group_host, hdlr, run_within(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), and SWC_LOG_CURRENT_EXCEPTION.

+ Here is the call graph for this function:

◆ handle_no_conn()

void SWC::Comm::Protocol::Mngr::Req::MngrActive::handle_no_conn ( )
overridevirtual

Implements SWC::Comm::DispatchHandler.

Definition at line 43 of file MngrActive.cc.

References cid, SWC::Core::Vector< T, SizeT, GROW_SZ >::clear(), clients, hdlr, hosts, SWC::LOG_DEBUG, nxt, role, run(), run_within(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), SWC_FMT_LU, SWC_LOGF, and SWC::Core::type_name().

+ Here is the call graph for this function:

◆ make() [1/2]

static SWC_CAN_INLINE Ptr SWC::Comm::Protocol::Mngr::Req::MngrActive::make ( const SWC::client::Clients::Ptr clients,
const cid_t a_cid,
const DispatchHandler::Ptr hdlr,
uint32_t  timeout_ms = 60000 
)
inlinestatic

Definition at line 25 of file MngrActive.h.

References clients, SWC::DB::Types::MngrRole::COLUMNS, hdlr, MngrActive(), and timeout_ms.

Referenced by SWC::client::Managers::put(), SWC::client::Managers::put_role_schemas(), SWC::Comm::Protocol::Mngr::Req::ColumnStatus::run(), SWC::Comm::Protocol::Mngr::Req::RangersStatus::run(), SWC::Comm::Protocol::Mngr::Req::ManagersStatus::run(), and SWC::Comm::Protocol::Mngr::Req::RgrMngId::run().

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

◆ make() [2/2]

static SWC_CAN_INLINE Ptr SWC::Comm::Protocol::Mngr::Req::MngrActive::make ( const SWC::client::Clients::Ptr clients,
const uint8_t &  a_role,
const DispatchHandler::Ptr hdlr,
uint32_t  timeout_ms = 60000 
)
inlinestatic

Definition at line 33 of file MngrActive.h.

References clients, hdlr, MngrActive(), SWC::DB::SchemaPrimitives::NO_CID, and timeout_ms.

+ Here is the call graph for this function:

◆ run()

bool SWC::Comm::Protocol::Mngr::Req::MngrActive::run ( )
overridevirtual

Reimplemented from SWC::Comm::DispatchHandler.

Definition at line 60 of file MngrActive.cc.

References cid, clients, SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), group_host, hdlr, hosts, SWC::LOG_WARN, nxt, SWC::Comm::client::ConnQueueReqBase::req(), role, run_within(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), SWC_FMT_LU, SWC_LOGF, and SWC::Core::type_name().

Referenced by handle_no_conn().

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

◆ run_within()

void SWC::Comm::Protocol::Mngr::Req::MngrActive::run_within ( uint32_t  t_ms = 1000)

Definition at line 15 of file MngrActive.cc.

References clients, hdlr, SWC_CAN_INLINE, and timer.

Referenced by handle(), handle_no_conn(), and run().

+ Here is the caller graph for this function:

Member Data Documentation

◆ cid

const cid_t SWC::Comm::Protocol::Mngr::Req::MngrActive::cid
private

Definition at line 71 of file MngrActive.h.

Referenced by handle_no_conn(), and run().

◆ clients

SWC::client::Clients::Ptr SWC::Comm::Protocol::Mngr::Req::MngrActive::clients
private

Definition at line 69 of file MngrActive.h.

Referenced by handle(), handle_no_conn(), make(), run(), and run_within().

◆ group_host

SWC::client::Mngr::Groups::GroupHost SWC::Comm::Protocol::Mngr::Req::MngrActive::group_host
private

Definition at line 75 of file MngrActive.h.

Referenced by handle(), and run().

◆ hdlr

DispatchHandler::Ptr SWC::Comm::Protocol::Mngr::Req::MngrActive::hdlr
private

Definition at line 72 of file MngrActive.h.

Referenced by handle(), handle_no_conn(), make(), run(), and run_within().

◆ hosts

SWC::client::Mngr::Hosts SWC::Comm::Protocol::Mngr::Req::MngrActive::hosts
private

Definition at line 74 of file MngrActive.h.

Referenced by handle_no_conn(), and run().

◆ nxt

size_t SWC::Comm::Protocol::Mngr::Req::MngrActive::nxt
private

Definition at line 73 of file MngrActive.h.

Referenced by handle_no_conn(), and run().

◆ role

const uint8_t SWC::Comm::Protocol::Mngr::Req::MngrActive::role
private

Definition at line 70 of file MngrActive.h.

Referenced by handle_no_conn(), and run().

◆ timeout_ms

const uint32_t SWC::Comm::Protocol::Mngr::Req::MngrActive::timeout_ms
protected

Definition at line 79 of file MngrActive.h.

Referenced by make().

◆ timer

asio::high_resolution_timer SWC::Comm::Protocol::Mngr::Req::MngrActive::timer
private

Definition at line 76 of file MngrActive.h.

Referenced by run_within().


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