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::Query::Select::Handlers::Common Class Reference

#include <swcdb/db/client/Query/Select/Handlers/Common.h>

+ Inheritance diagram for SWC::client::Query::Select::Handlers::Common:
+ Collaboration diagram for SWC::client::Query::Select::Handlers::Common:

Public Types

typedef std::shared_ptr< CommonPtr
 
typedef std::function< void(Ptr)> Cb_t
 
- Public Types inherited from SWC::client::Query::Select::Handlers::BaseUnorderedMap
typedef std::shared_ptr< BaseUnorderedMapPtr
 
- Public Types inherited from SWC::client::Query::Select::Handlers::Base
typedef std::shared_ptr< BasePtr
 

Public Member Functions

 Common (const Clients::Ptr &clients, Cb_t &&cb, bool rsp_partials=false, const Comm::IoContextPtr &io=nullptr, Clients::Flag executor=Clients::DEFAULT) noexcept
 
virtual ~Common () noexcept
 
virtual bool valid () noexcept override
 
virtual bool add_cells (const cid_t cid, StaticBuffer &buffer, bool reached_limit, DB::Specs::Interval &interval) override
 
virtual void get_cells (const cid_t cid, DB::Cells::Result &cells) override
 
virtual void free (const cid_t cid) override
 
virtual void response (int err) override
 
void wait ()
 
- Public Member Functions inherited from SWC::client::Query::Select::Handlers::BaseUnorderedMap
SWC_CAN_INLINE BaseUnorderedMap (const Clients::Ptr &a_clients, Clients::Flag a_executor=Clients::DEFAULT) noexcept
 
virtual ~BaseUnorderedMap () noexcept
 
virtual void error (const cid_t cid, int err) override
 
virtual size_t get_size_bytes () noexcept override
 
void add_column (const cid_t cid)
 
Rsp::Ptrget_columnn (const cid_t cid)
 
SWC_CAN_INLINE size_t get_size (const cid_t cid)
 
bool empty () noexcept
 
cids_t get_cids ()
 
void remove (const cid_t cid)
 
virtual void error (const cid_t cid, int err)=0
 
virtual int error () noexcept
 
virtual void error (int err) noexcept
 
- Public Member Functions inherited from SWC::client::Query::Select::Handlers::Base
SWC_CAN_INLINE Base (const Clients::Ptr &a_clients, Clients::Flag a_executor=Clients::DEFAULT) noexcept
 
 Base (Base &&)=delete
 
 Base (const Base &)=delete
 
Baseoperator= (const Base &)=delete
 
Baseoperator= (Base &&)=delete
 
virtual void error (int err) noexcept
 
SWC_CAN_INLINE void scan (const DB::Schema::Ptr &schema, const DB::Specs::Interval &intval)
 
SWC_CAN_INLINE void scan (const DB::Schema::Ptr &schema, DB::Specs::Interval &&intval)
 
SWC_CAN_INLINE void scan (DB::Types::KeySeq key_seq, cid_t cid, const DB::Specs::Interval &intval)
 
SWC_CAN_INLINE void scan (DB::Types::KeySeq key_seq, cid_t cid, DB::Specs::Interval &&intval)
 
SWC_CAN_INLINE void scan (int &err, const DB::Specs::Scan &specs)
 
SWC_CAN_INLINE void scan (int &err, DB::Specs::Scan &&specs)
 

Static Public Member Functions

static SWC_CAN_INLINE Ptr make (const Clients::Ptr &clients, Cb_t &&cb=nullptr, bool rsp_partials=false, const Comm::IoContextPtr &io=nullptr, Clients::Flag executor=Clients::DEFAULT)
 

Public Attributes

Core::AtomicBool valid_state
 
- Public Attributes inherited from SWC::client::Query::Select::Handlers::Base
Clients::Ptr clients
 
Profiling profile
 
Core::Atomic< int > state_error
 
Core::CompletionCounter< uint64_t > completion
 
Core::Atomic< uint32_t > timeout
 
Core::Atomic< uint32_t > buff_sz
 
Core::Atomic< uint8_t > buff_ahead
 
const Clients::Flag executor
 

Protected Attributes

std::mutex m_mutex
 

Private Member Functions

void response_partials ()
 
bool wait_on_partials ()
 
void send_result ()
 

Private Attributes

const Cb_t m_cb
 
Comm::IoContextPtr m_dispatcher_io
 
const bool m_notify
 
std::condition_variable m_cv
 
Core::StateRunning m_sending_result
 

Additional Inherited Members

- Protected Member Functions inherited from SWC::client::Query::Select::Handlers::Base
virtual void _execute (DB::Types::KeySeq key_seq, cid_t cid, const DB::Specs::Interval &intval)
 
virtual void _execute (DB::Types::KeySeq key_seq, cid_t cid, DB::Specs::Interval &&intval)
 
virtual void _execute (int &err, const DB::Specs::Scan &specs)
 
virtual void _execute (int &err, DB::Specs::Scan &&specs)
 
virtual ~Base () noexcept
 

Detailed Description

Definition at line 19 of file Common.h.

Member Typedef Documentation

◆ Cb_t

Definition at line 23 of file Common.h.

◆ Ptr

Definition at line 22 of file Common.h.

Constructor & Destructor Documentation

◆ Common()

SWC::client::Query::Select::Handlers::Common::Common ( const Clients::Ptr clients,
Cb_t &&  cb,
bool  rsp_partials = false,
const Comm::IoContextPtr io = nullptr,
Clients::Flag  executor = Clients::DEFAULT 
)
noexcept

Definition at line 17 of file Common.cc.

Referenced by make().

+ Here is the caller graph for this function:

◆ ~Common()

virtual SWC::client::Query::Select::Handlers::Common::~Common ( )
inlinevirtualnoexcept

Definition at line 41 of file Common.h.

Member Function Documentation

◆ add_cells()

bool SWC::client::Query::Select::Handlers::Common::add_cells ( const cid_t  cid,
StaticBuffer buffer,
bool  reached_limit,
DB::Specs::Interval interval 
)
overridevirtual

Reimplemented from SWC::client::Query::Select::Handlers::BaseUnorderedMap.

Definition at line 30 of file Common.cc.

References SWC::client::Query::Select::Handlers::BaseUnorderedMap::add_cells(), and response_partials().

+ Here is the call graph for this function:

◆ free()

void SWC::client::Query::Select::Handlers::Common::free ( const cid_t  cid)
overridevirtual

Reimplemented from SWC::client::Query::Select::Handlers::BaseUnorderedMap.

Definition at line 46 of file Common.cc.

References SWC::client::Query::Select::Handlers::BaseUnorderedMap::free(), m_cv, m_mutex, and m_notify.

+ Here is the call graph for this function:

◆ get_cells()

void SWC::client::Query::Select::Handlers::Common::get_cells ( const cid_t  cid,
DB::Cells::Result cells 
)
overridevirtual

Reimplemented from SWC::client::Query::Select::Handlers::BaseUnorderedMap.

Definition at line 38 of file Common.cc.

References SWC::client::Query::Select::Handlers::BaseUnorderedMap::get_cells(), m_cv, m_mutex, and m_notify.

+ Here is the call graph for this function:

◆ make()

static SWC_CAN_INLINE Ptr SWC::client::Query::Select::Handlers::Common::make ( const Clients::Ptr clients,
Cb_t &&  cb = nullptr,
bool  rsp_partials = false,
const Comm::IoContextPtr io = nullptr,
Clients::Flag  executor = Clients::DEFAULT 
)
inlinestatic

Definition at line 26 of file Common.h.

References SWC::client::Query::Select::Handlers::Base::clients, Common(), and SWC::client::Query::Select::Handlers::Base::executor.

Referenced by SWC::Manager::ColumnHealthCheck::finishing(), SWC::Manager::MngdColumns::remove(), SWC::Utils::LoadGenerator::select_data(), SWC::Utils::shell::Statistics::set_definitions(), SWC::Utils::shell::Statistics::show(), SWC::ThriftBroker::AppHandler::sync_select(), and SWC::Utils::shell::Statistics::truncate().

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

◆ response()

void SWC::client::Query::Select::Handlers::Common::response ( int  err)
overridevirtual

◆ response_partials()

void SWC::client::Query::Select::Handlers::Common::response_partials ( )
private

Definition at line 75 of file Common.cc.

References m_cv, m_mutex, m_notify, m_sending_result, SWC::Core::StateRunning::running(), send_result(), and wait_on_partials().

Referenced by add_cells().

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

◆ send_result()

void SWC::client::Query::Select::Handlers::Common::send_result ( )
private

Definition at line 115 of file Common.cc.

References SWC::client::Query::Select::Handlers::Base::clients, m_dispatcher_io, SWC::client::Query::Select::Handlers::Base::operator=(), and SWC_CAN_INLINE.

Referenced by response(), response_partials(), and wait().

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

◆ valid()

bool SWC::client::Query::Select::Handlers::Common::valid ( )
overridevirtualnoexcept

Implements SWC::client::Query::Select::Handlers::Base.

Definition at line 71 of file Common.cc.

References valid_state.

Referenced by wait(), and wait_on_partials().

+ Here is the caller graph for this function:

◆ wait()

void SWC::client::Query::Select::Handlers::Common::wait ( )

Definition at line 97 of file Common.cc.

References SWC::client::Query::Select::Handlers::Base::completion, SWC::Core::CompletionCounter< CountT >::count(), SWC::client::Query::Select::Handlers::BaseUnorderedMap::empty(), m_cv, m_mutex, m_notify, m_sending_result, SWC::Core::StateRunning::running(), send_result(), and valid().

+ Here is the call graph for this function:

◆ wait_on_partials()

bool SWC::client::Query::Select::Handlers::Common::wait_on_partials ( )
private

Definition at line 93 of file Common.cc.

References SWC::client::Query::Select::Handlers::Base::buff_ahead, SWC::client::Query::Select::Handlers::Base::buff_sz, SWC::client::Query::Select::Handlers::BaseUnorderedMap::get_size_bytes(), and valid().

Referenced by response_partials().

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

Member Data Documentation

◆ m_cb

const Cb_t SWC::client::Query::Select::Handlers::Common::m_cb
private

Definition at line 68 of file Common.h.

Referenced by response().

◆ m_cv

std::condition_variable SWC::client::Query::Select::Handlers::Common::m_cv
private

Definition at line 71 of file Common.h.

Referenced by free(), get_cells(), response(), response_partials(), and wait().

◆ m_dispatcher_io

Comm::IoContextPtr SWC::client::Query::Select::Handlers::Common::m_dispatcher_io
private

Definition at line 69 of file Common.h.

Referenced by send_result().

◆ m_mutex

std::mutex SWC::client::Query::Select::Handlers::Common::m_mutex
protected

Definition at line 58 of file Common.h.

Referenced by free(), get_cells(), response(), response_partials(), and wait().

◆ m_notify

const bool SWC::client::Query::Select::Handlers::Common::m_notify
private

Definition at line 70 of file Common.h.

Referenced by free(), get_cells(), response_partials(), and wait().

◆ m_sending_result

Core::StateRunning SWC::client::Query::Select::Handlers::Common::m_sending_result
private

Definition at line 72 of file Common.h.

Referenced by response(), response_partials(), and wait().

◆ valid_state

Core::AtomicBool SWC::client::Query::Select::Handlers::Common::valid_state

Definition at line 34 of file Common.h.

Referenced by valid().


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