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::Manager::Ranger Class Referencefinal

#include <swcdb/manager/Ranger.h>

+ Collaboration diagram for SWC::Manager::Ranger:

Public Types

typedef std::shared_ptr< RangerPtr
 

Public Member Functions

SWC_CAN_INLINE Ranger (rgrid_t a_rgrid, const Comm::EndPoints &a_endpoints)
 
SWC_CAN_INLINE Ranger (const uint8_t **bufp, size_t *remainp)
 
SWC_CAN_INLINE Ranger (const Ranger &other, const Comm::EndPoints &a_endpoints)
 
 ~Ranger () noexcept
 
void print (std::ostream &out) const
 
size_t encoded_length () const noexcept
 
void encode (uint8_t **bufp) const
 
SWC_CAN_INLINE void init_queue ()
 
SWC_CAN_INLINE void put (const Comm::client::ConnQueue::ReqBase::Ptr &req)
 
void stop ()
 
SWC_CAN_INLINE void rebalance (uint8_t num)
 
SWC_CAN_INLINE uint8_t rebalance () const
 
SWC_CAN_INLINE bool can_rebalance ()
 

Public Attributes

Core::Atomic< rgrid_trgrid
 
Comm::EndPoints endpoints
 
Core::Atomic< size_t > interm_ranges
 
Core::Atomic< int16_t > failures
 
Core::Atomic< uint16_t > load_scale
 
Core::Atomic< uint8_t > state
 

Private Attributes

Core::MutexAtomic m_mutex
 
uint8_t m_rebalance
 
Comm::client::Host::Ptr m_queue
 

Detailed Description

Definition at line 17 of file Ranger.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Ranger> SWC::Manager::Ranger::Ptr

Definition at line 21 of file Ranger.h.

Constructor & Destructor Documentation

◆ Ranger() [1/3]

SWC_CAN_INLINE SWC::Manager::Ranger::Ranger ( rgrid_t  a_rgrid,
const Comm::EndPoints a_endpoints 
)
inline

Definition at line 33 of file Ranger.h.

◆ Ranger() [2/3]

SWC_CAN_INLINE SWC::Manager::Ranger::Ranger ( const uint8_t **  bufp,
size_t *  remainp 
)
inline

Definition at line 41 of file Ranger.h.

◆ Ranger() [3/3]

SWC_CAN_INLINE SWC::Manager::Ranger::Ranger ( const Ranger other,
const Comm::EndPoints a_endpoints 
)
inline

Definition at line 52 of file Ranger.h.

◆ ~Ranger()

SWC::Manager::Ranger::~Ranger ( )
inlinenoexcept

Definition at line 63 of file Ranger.h.

Member Function Documentation

◆ can_rebalance()

SWC_CAN_INLINE bool SWC::Manager::Ranger::can_rebalance ( )
inline

Definition at line 120 of file Ranger.h.

References m_mutex, and m_rebalance.

◆ encode()

void SWC::Manager::Ranger::encode ( uint8_t **  bufp) const
inline

Definition at line 85 of file Ranger.h.

References SWC::Serialization::encode(), SWC::Serialization::encode_i16(), SWC::Serialization::encode_i8(), SWC::Serialization::encode_vi64(), endpoints, SWC::Core::AtomicBase< T, OrderT >::load(), load_scale, rebalance(), rgrid, and state.

+ Here is the call graph for this function:

◆ encoded_length()

size_t SWC::Manager::Ranger::encoded_length ( ) const
inlinenoexcept

Definition at line 78 of file Ranger.h.

References SWC::Serialization::encoded_length(), SWC::Serialization::encoded_length_vi64(), endpoints, SWC::Core::AtomicBase< T, OrderT >::load(), and rgrid.

+ Here is the call graph for this function:

◆ init_queue()

SWC_CAN_INLINE void SWC::Manager::Ranger::init_queue ( )
inline

Definition at line 94 of file Ranger.h.

References endpoints, SWC::Env::Clients::get(), and m_queue.

+ Here is the call graph for this function:

◆ print()

void SWC::Manager::Ranger::print ( std::ostream &  out) const
inline

Definition at line 65 of file Ranger.h.

References endpoints, failures, interm_ranges, SWC::Core::AtomicBase< T, OrderT >::load(), load_scale, m_queue, SWC::Comm::print(), rebalance(), rgrid, state, and SWC::Core::to_string().

+ Here is the call graph for this function:

◆ put()

SWC_CAN_INLINE void SWC::Manager::Ranger::put ( const Comm::client::ConnQueue::ReqBase::Ptr req)
inline

Definition at line 99 of file Ranger.h.

References m_queue.

◆ rebalance() [1/2]

SWC_CAN_INLINE uint8_t SWC::Manager::Ranger::rebalance ( ) const
inline

Definition at line 114 of file Ranger.h.

References m_mutex, and m_rebalance.

Referenced by encode(), and print().

+ Here is the caller graph for this function:

◆ rebalance() [2/2]

SWC_CAN_INLINE void SWC::Manager::Ranger::rebalance ( uint8_t  num)
inline

Definition at line 108 of file Ranger.h.

References m_mutex, and m_rebalance.

◆ stop()

void SWC::Manager::Ranger::stop ( )
inline

Definition at line 103 of file Ranger.h.

References m_queue.

Member Data Documentation

◆ endpoints

Comm::EndPoints SWC::Manager::Ranger::endpoints

Definition at line 131 of file Ranger.h.

Referenced by encode(), encoded_length(), init_queue(), and print().

◆ failures

Core::Atomic<int16_t> SWC::Manager::Ranger::failures

Definition at line 133 of file Ranger.h.

Referenced by print().

◆ interm_ranges

Core::Atomic<size_t> SWC::Manager::Ranger::interm_ranges

Definition at line 132 of file Ranger.h.

Referenced by print().

◆ load_scale

Core::Atomic<uint16_t> SWC::Manager::Ranger::load_scale

Definition at line 134 of file Ranger.h.

Referenced by encode(), and print().

◆ m_mutex

Core::MutexAtomic SWC::Manager::Ranger::m_mutex
mutableprivate

Definition at line 140 of file Ranger.h.

Referenced by can_rebalance(), and rebalance().

◆ m_queue

Comm::client::Host::Ptr SWC::Manager::Ranger::m_queue
private

Definition at line 142 of file Ranger.h.

Referenced by init_queue(), print(), put(), and stop().

◆ m_rebalance

uint8_t SWC::Manager::Ranger::m_rebalance
private

Definition at line 141 of file Ranger.h.

Referenced by can_rebalance(), and rebalance().

◆ rgrid

Core::Atomic<rgrid_t> SWC::Manager::Ranger::rgrid

Definition at line 130 of file Ranger.h.

Referenced by encode(), encoded_length(), and print().

◆ state

Core::Atomic<uint8_t> SWC::Manager::Ranger::state

Definition at line 135 of file Ranger.h.

Referenced by encode(), and print().


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