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::CachedRangers Class Referencefinal

#include <swcdb/db/client/service/rgr/Cache.h>

+ Inheritance diagram for SWC::client::CachedRangers:
+ Collaboration diagram for SWC::client::CachedRangers:

Public Member Functions

SWC_CAN_INLINE CachedRangers (const Config::Property::Value_int32_g::Ptr expiry_ms) noexcept
 
 CachedRangers (const CachedRangers &)=delete
 
CachedRangersoperator= (const CachedRangers &)=delete
 
SWC_CAN_INLINE ~CachedRangers () noexcept
 
void clear ()
 
void clear_expired ()
 
void remove (const cid_t cid, const rid_t rid)
 
bool get (const cid_t cid, const rid_t rid, Comm::EndPoints &endpoints)
 
void set (const cid_t cid, const rid_t rid, const Comm::EndPoints &endpoints)
 

Private Types

typedef std::unordered_map< cid_t, std::unordered_map< rid_t, RangeEndPoints > > Map
 

Private Attributes

Core::MutexSptd m_mutex
 
Config::Property::Value_int32_g::Ptr m_expiry_ms
 

Detailed Description

Definition at line 40 of file Cache.h.

Member Typedef Documentation

◆ Map

typedef std::unordered_map< cid_t, std::unordered_map<rid_t, RangeEndPoints> > SWC::client::CachedRangers::Map
private

Definition at line 45 of file Cache.h.

Constructor & Destructor Documentation

◆ CachedRangers() [1/2]

SWC_CAN_INLINE SWC::client::CachedRangers::CachedRangers ( const Config::Property::Value_int32_g::Ptr  expiry_ms)
inlinenoexcept

Definition at line 50 of file Cache.h.

◆ CachedRangers() [2/2]

SWC::client::CachedRangers::CachedRangers ( const CachedRangers )
delete

◆ ~CachedRangers()

SWC_CAN_INLINE SWC::client::CachedRangers::~CachedRangers ( )
inlinenoexcept

Definition at line 59 of file Cache.h.

Member Function Documentation

◆ clear()

void SWC::client::CachedRangers::clear ( )

Definition at line 14 of file Cache.cc.

References m_mutex.

◆ clear_expired()

void SWC::client::CachedRangers::clear_expired ( )

Definition at line 19 of file Cache.cc.

References SWC::Config::Property::Value_int32_g::get(), m_expiry_ms, m_mutex, and SWC::Time::now_ms().

+ Here is the call graph for this function:

◆ get()

bool SWC::client::CachedRangers::get ( const cid_t  cid,
const rid_t  rid,
Comm::EndPoints endpoints 
)

Definition at line 52 of file Cache.cc.

References SWC::Config::Property::Value_int32_g::get(), m_expiry_ms, m_mutex, and SWC::Time::now_ms().

Referenced by SWC::client::Clients::rgr_cache_get().

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

◆ operator=()

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

◆ remove()

void SWC::client::CachedRangers::remove ( const cid_t  cid,
const rid_t  rid 
)

Definition at line 38 of file Cache.cc.

References m_mutex.

Referenced by SWC::client::Clients::rgr_cache_remove().

+ Here is the caller graph for this function:

◆ set()

void SWC::client::CachedRangers::set ( const cid_t  cid,
const rid_t  rid,
const Comm::EndPoints endpoints 
)

Definition at line 67 of file Cache.cc.

References m_mutex, and SWC::Time::now_ms().

Referenced by SWC::client::Clients::rgr_cache_set().

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

Member Data Documentation

◆ m_expiry_ms

Config::Property::Value_int32_g::Ptr SWC::client::CachedRangers::m_expiry_ms
private

Definition at line 75 of file Cache.h.

Referenced by clear_expired(), and get().

◆ m_mutex

Core::MutexSptd SWC::client::CachedRangers::m_mutex
private

Definition at line 74 of file Cache.h.

Referenced by clear(), clear_expired(), get(), remove(), and set().


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