proxygen
wangle::LRUPersistentCache< K, V, MutexT > Class Template Reference

#include <LRUPersistentCache.h>

Inheritance diagram for wangle::LRUPersistentCache< K, V, MutexT >:
wangle::PersistentCache< K, V >

Public Types

using Ptr = std::shared_ptr< LRUPersistentCache< K, V, MutexT >>
 

Public Member Functions

 LRUPersistentCache (std::size_t cacheCapacity, std::chrono::milliseconds syncInterval=client::persistence::DEFAULT_CACHE_SYNC_INTERVAL, int nSyncRetries=client::persistence::DEFAULT_CACHE_SYNC_RETRIES, std::unique_ptr< CachePersistence< K, V >> persistence=nullptr)
 
 LRUPersistentCache (std::shared_ptr< folly::Executor > executor, std::size_t cacheCapacity, std::chrono::milliseconds syncInterval, int nSyncRetries, std::unique_ptr< CachePersistence< K, V >> persistence)
 
 ~LRUPersistentCache () override
 
bool hasPendingUpdates ()
 
folly::Optional< V > get (const K &key) override
 
void put (const K &key, const V &val) override
 
bool remove (const K &key) override
 
void clear (bool clearPersistence=false) override
 
size_t size () override
 
void setSyncOnDestroy (bool syncOnDestroy)
 
void setPersistence (std::unique_ptr< CachePersistence< K, V >> persistence)
 
- Public Member Functions inherited from wangle::PersistentCache< K, V >
virtual ~PersistentCache ()
 

Private Member Functions

void setPersistenceHelper (std::unique_ptr< CachePersistence< K, V >> persistence, bool syncVersion) noexcept
 
CacheDataVersion load (CachePersistence< K, V > &persistence) noexcept
 
void sync ()
 
void oneShotSync ()
 
bool syncNow (CachePersistence< K, V > &persistence)
 
std::shared_ptr< CachePersistence< K, V > > getPersistence ()
 

Static Private Member Functions

static void * syncThreadMain (void *arg)
 

Private Attributes

LRUInMemoryCache< K, V, MutexT > cache_
 
bool stopSyncer_ {false}
 
std::mutex stopSyncerMutex_
 
std::condition_variable stopSyncerCV_
 
std::atomic_flag executorScheduled_ = ATOMIC_FLAG_INIT
 
const std::chrono::milliseconds syncInterval_
 
const int nSyncRetries_ {client::persistence::DEFAULT_CACHE_SYNC_RETRIES}
 
int nSyncTries_ {0}
 
std::chrono::steady_clock::time_point lastExecutorScheduleTime_
 
bool syncOnDestroy_ {false}
 
std::shared_ptr< CachePersistence< K, V > > persistence_
 
MutexT persistenceLock_
 
std::thread syncer_
 
std::shared_ptr< folly::Executorexecutor_
 

Detailed Description

template<typename K, typename V, typename MutexT = std::mutex>
class wangle::LRUPersistentCache< K, V, MutexT >

A PersistentCache implementation that used a CachePersistence for storage. In memory structure fronts the persistence and the cache operations happen on it. Loading from and syncing to persistence are hidden from clients. Sync to persistence happens asynchronously on a separate thread at a configurable interval. Syncs to persistence on destruction as well.

The in memory structure is an EvictingCacheMap which causes this class to evict entries in an LRU fashion.

NOTE NOTE NOTE: Although this class aims to be a cache for arbitrary, it relies heavily on folly::toJson, folly::dynamic and convertTo for serialization and deserialization. So It may not suit your need until true support arbitrary types is written.

Definition at line 119 of file LRUPersistentCache.h.

Member Typedef Documentation

template<typename K, typename V, typename MutexT = std::mutex>
using wangle::LRUPersistentCache< K, V, MutexT >::Ptr = std::shared_ptr<LRUPersistentCache<K, V, MutexT>>

Definition at line 124 of file LRUPersistentCache.h.

Constructor & Destructor Documentation

template<typename K, typename V, typename MutexT >
wangle::LRUPersistentCache< K, V, MutexT >::LRUPersistentCache ( std::size_t  cacheCapacity,
std::chrono::milliseconds  syncInterval = client::persistence::DEFAULT_CACHE_SYNC_INTERVAL,
int  nSyncRetries = client::persistence::DEFAULT_CACHE_SYNC_RETRIES,
std::unique_ptr< CachePersistence< K, V >>  persistence = nullptr 
)
explicit

LRUPersistentCache constructor

Parameters
cacheCapacitymax number of elements to hold in the cache.
syncIntervalhow often to sync to the persistence (in ms).
nSyncRetrieshow many times to retry to sync on failure.

Loads the cache and starts of the syncer thread that periodically syncs the cache to persistence.

If persistence is specified, the cache is initially loaded with the contents from it. If load fails, then cache starts empty.

On write failures, the sync will happen again up to nSyncRetries times. Once failed nSyncRetries amount of time, then it will give up and not attempt to sync again until another update occurs.

On reaching capacity limit, LRU items are evicted.

Definition at line 31 of file LRUPersistentCache-inl.h.

37  nullptr,
38  cacheCapacity,
39  syncInterval,
40  nSyncRetries,
41  std::move(persistence)) {
42 }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
LRUPersistentCache(std::size_t cacheCapacity, std::chrono::milliseconds syncInterval=client::persistence::DEFAULT_CACHE_SYNC_INTERVAL, int nSyncRetries=client::persistence::DEFAULT_CACHE_SYNC_RETRIES, std::unique_ptr< CachePersistence< K, V >> persistence=nullptr)
template<typename K, typename V, typename MutexT >
wangle::LRUPersistentCache< K, V, MutexT >::LRUPersistentCache ( std::shared_ptr< folly::Executor executor,
std::size_t  cacheCapacity,
std::chrono::milliseconds  syncInterval,
int  nSyncRetries,
std::unique_ptr< CachePersistence< K, V >>  persistence 
)

Definition at line 45 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::executor_, folly::gen::move, wangle::LRUPersistentCache< K, V, MutexT >::setPersistenceHelper(), and wangle::LRUPersistentCache< K, V, MutexT >::syncer_.

51  : cache_(cacheCapacity),
52  syncInterval_(syncInterval),
53  nSyncRetries_(nSyncRetries),
55  // load the cache. be silent if load fails, we just drop the cache
56  // and start from scratch.
57  if (persistence) {
58  setPersistenceHelper(std::move(persistence), true);
59  }
60  if (!executor_) {
61  // start the syncer thread. done at the end of construction so that the
62  // cache is fully initialized before being passed to the syncer thread.
63  syncer_ =
65  }
66 }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::shared_ptr< folly::Executor > executor_
PUSHMI_INLINE_VAR constexpr __adl::get_executor_fn executor
void setPersistenceHelper(std::unique_ptr< CachePersistence< K, V >> persistence, bool syncVersion) noexcept
LRUInMemoryCache< K, V, MutexT > cache_
const std::chrono::milliseconds syncInterval_
static void * syncThreadMain(void *arg)
template<typename K , typename V , typename MutexT >
wangle::LRUPersistentCache< K, V, MutexT >::~LRUPersistentCache ( )
override

LRUPersistentCache Destructor

Signals the syncer thread to stop, waits for any pending syncs to be done.

Definition at line 69 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::executor_, folly::detail::lock(), wangle::LRUPersistentCache< K, V, MutexT >::oneShotSync(), wangle::LRUPersistentCache< K, V, MutexT >::stopSyncer_, wangle::LRUPersistentCache< K, V, MutexT >::stopSyncerCV_, wangle::LRUPersistentCache< K, V, MutexT >::stopSyncerMutex_, wangle::LRUPersistentCache< K, V, MutexT >::syncer_, and wangle::LRUPersistentCache< K, V, MutexT >::syncOnDestroy_.

69  {
70  if (executor_) {
71  // In executor mode, each task holds a weak_ptr to the cache itself. No need
72  // to notify them the cache is dying. We are done here. Alternatively we may
73  // want to do a final sync upon destruction.
74  return;
75  }
76  {
77  // tell syncer to wake up and quit
78  std::lock_guard<std::mutex> lock(stopSyncerMutex_);
79  stopSyncer_ = true;
80  if (syncOnDestroy_) {
81  // Sync on the thread of the destroyer.
82  oneShotSync();
83  }
84  stopSyncerCV_.notify_all();
85  }
86  syncer_.join();
87 }
std::condition_variable stopSyncerCV_
std::shared_ptr< folly::Executor > executor_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
Definition: Synchronized.h:871

Member Function Documentation

template<typename K, typename V, typename MutexT = std::mutex>
void wangle::LRUPersistentCache< K, V, MutexT >::clear ( bool  clearPersistence = false)
inlineoverridevirtual

Empty the contents of the cache

Implements wangle::PersistentCache< K, V >.

Definition at line 184 of file LRUPersistentCache.h.

Referenced by wangle::FilePersistentCache< K, V, M >::clear().

184  {
185  cache_.clear();
186  if (clearPersistence) {
187  auto persistence = getPersistence();
188  if (persistence) {
189  persistence->clear();
190  }
191  }
192  }
LRUInMemoryCache< K, V, MutexT > cache_
std::shared_ptr< CachePersistence< K, V > > getPersistence()
template<typename K, typename V, typename MutexT = std::mutex>
folly::Optional<V> wangle::LRUPersistentCache< K, V, MutexT >::get ( const K &  key)
inlineoverridevirtual

PersistentCache operations

Implements wangle::PersistentCache< K, V >.

Definition at line 174 of file LRUPersistentCache.h.

Referenced by wangle::FilePersistentCache< K, V, M >::get().

174  {
175  return cache_.get(key);
176  }
LRUInMemoryCache< K, V, MutexT > cache_
template<typename K , typename V , typename MutexT >
std::shared_ptr< CachePersistence< K, V > > wangle::LRUPersistentCache< K, V, MutexT >::getPersistence ( )
private

Helper to get the persistence layer under lock since it will be called by syncer thread and setters call from any thread.

Definition at line 206 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::persistence_, and wangle::LRUPersistentCache< K, V, MutexT >::persistenceLock_.

Referenced by wangle::LRUPersistentCache< K, V, MutexT >::oneShotSync(), and wangle::LRUPersistentCache< K, V, MutexT >::sync().

206  {
208  return persistence_;
209 }
std::shared_ptr< CachePersistence< K, V > > persistence_
template<typename K , typename V , typename MutexT >
bool wangle::LRUPersistentCache< K, V, MutexT >::hasPendingUpdates ( )

Check if there are updates that need to be synced to persistence

Definition at line 112 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::cache_, wangle::LRUPersistentCache< K, V, MutexT >::persistence_, and wangle::LRUPersistentCache< K, V, MutexT >::persistenceLock_.

112  {
114  if (!persistence_) {
115  return false;
116  }
117  return cache_.hasChangedSince(persistence_->getLastPersistedVersion());
118 }
std::shared_ptr< CachePersistence< K, V > > persistence_
LRUInMemoryCache< K, V, MutexT > cache_
template<typename K, typename V, typename MutexT >
CacheDataVersion wangle::LRUPersistentCache< K, V, MutexT >::load ( CachePersistence< K, V > &  persistence)
privatenoexcept

Load the contents of the persistence passed to constructor in to the in-memory cache. Failure to read will result in no changes to the in-memory data. That is, if in-memory entries exist, and loading fails, the in-memory data remains and will sync down to the underlying persistence layer on the next sync.

Failure to read inclues IO errors and deserialization errors.

Returns
the in memory cache's new version

Definition at line 236 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::cache_.

Referenced by wangle::LRUPersistentCache< K, V, MutexT >::setPersistenceHelper().

237  {
238  auto kvPairs = persistence.load();
239  if (!kvPairs) {
240  return false;
241  }
242  return cache_.loadData(kvPairs.value());
243 }
LRUInMemoryCache< K, V, MutexT > cache_
template<typename K , typename V , typename MutexT >
void wangle::LRUPersistentCache< K, V, MutexT >::oneShotSync ( )
private

Definition at line 130 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::cache_, wangle::LRUPersistentCache< K, V, MutexT >::executorScheduled_, wangle::LRUPersistentCache< K, V, MutexT >::getPersistence(), wangle::LRUPersistentCache< K, V, MutexT >::nSyncRetries_, wangle::LRUPersistentCache< K, V, MutexT >::nSyncTries_, and wangle::LRUPersistentCache< K, V, MutexT >::syncNow().

Referenced by wangle::LRUPersistentCache< K, V, MutexT >::~LRUPersistentCache().

130  {
131  executorScheduled_.clear();
132  auto persistence = getPersistence();
133  if (persistence && !syncNow(*persistence)) {
134  // track failures and give up if we tried too many times
135  ++nSyncTries_;
136  if (nSyncTries_ == nSyncRetries_) {
137  persistence->setPersistedVersion(cache_.getVersion());
138  nSyncTries_ = 0;
139  }
140  } else {
141  nSyncTries_ = 0;
142  }
143 }
std::atomic_flag executorScheduled_
LRUInMemoryCache< K, V, MutexT > cache_
bool syncNow(CachePersistence< K, V > &persistence)
std::shared_ptr< CachePersistence< K, V > > getPersistence()
template<typename K, typename V, typename MutexT >
void wangle::LRUPersistentCache< K, V, MutexT >::put ( const K &  key,
const V &  val 
)
overridevirtual

Set a value corresponding to a key

Parameters
keystring, the key to set
valstring, the value to set

overwrites value if key has a value associated in the cache

Implements wangle::PersistentCache< K, V >.

Definition at line 90 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::cache_, wangle::LRUPersistentCache< K, V, MutexT >::executor_, wangle::LRUPersistentCache< K, V, MutexT >::executorScheduled_, wangle::LRUPersistentCache< K, V, MutexT >::lastExecutorScheduleTime_, folly::detail::lock(), folly::gen::move, now(), and wangle::LRUPersistentCache< K, V, MutexT >::syncInterval_.

Referenced by wangle::FilePersistentCache< K, V, M >::put().

90  {
91  cache_.put(key, val);
92  if (executor_) {
93  if (!executorScheduled_.test_and_set()) {
95  syncInterval_) {
96  // Do not schedule more than once during a syncInterval_ period
97  return;
98  }
99  std::weak_ptr<LRUPersistentCache<K, V, MutexT>> weakSelf =
100  this->shared_from_this();
102  executor_->add([self = std::move(weakSelf)]() {
103  if (auto sharedSelf = self.lock()) {
104  sharedSelf->oneShotSync();
105  }
106  });
107  }
108  }
109 }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::chrono::steady_clock::time_point now()
double val
Definition: String.cpp:273
std::shared_ptr< folly::Executor > executor_
std::atomic_flag executorScheduled_
std::chrono::steady_clock::time_point lastExecutorScheduleTime_
LRUInMemoryCache< K, V, MutexT > cache_
auto lock(SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... >
Definition: Synchronized.h:871
const std::chrono::milliseconds syncInterval_
template<typename K, typename V, typename MutexT = std::mutex>
bool wangle::LRUPersistentCache< K, V, MutexT >::remove ( const K &  key)
inlineoverridevirtual

Clear a cache entry associated with a key

Parameters
keystring, the key to lookup and clear
Returns
boolean true if any elements are removed, else false

Implements wangle::PersistentCache< K, V >.

Definition at line 180 of file LRUPersistentCache.h.

Referenced by wangle::FilePersistentCache< K, V, M >::remove().

180  {
181  return cache_.remove(key);
182  }
LRUInMemoryCache< K, V, MutexT > cache_
template<typename K, typename V, typename MutexT >
void wangle::LRUPersistentCache< K, V, MutexT >::setPersistence ( std::unique_ptr< CachePersistence< K, V >>  persistence)

Set a new persistence layer on this cache. This call blocks while the new persistence layer is loaded into the cache. The load is also done under a lock so multiple calls to this will not stomp on each other.

Definition at line 227 of file LRUPersistentCache-inl.h.

References folly::gen::move, and wangle::LRUPersistentCache< K, V, MutexT >::setPersistenceHelper().

228  {
229  // note that we don't set the persisted version on the persistence like we
230  // do in the constructor since we want any deltas that were in memory but
231  // not in the persistence layer to sync back.
232  setPersistenceHelper(std::move(persistence), false);
233 }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void setPersistenceHelper(std::unique_ptr< CachePersistence< K, V >> persistence, bool syncVersion) noexcept
template<typename K, typename V, typename MutexT >
void wangle::LRUPersistentCache< K, V, MutexT >::setPersistenceHelper ( std::unique_ptr< CachePersistence< K, V >>  persistence,
bool  syncVersion 
)
privatenoexcept

Helper to set persistence that will load the persistence data into memory and optionally sync versions

Definition at line 212 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::load(), folly::gen::move, wangle::LRUPersistentCache< K, V, MutexT >::persistence_, wangle::LRUPersistentCache< K, V, MutexT >::persistenceLock_, and version.

Referenced by wangle::LRUPersistentCache< K, V, MutexT >::LRUPersistentCache(), and wangle::LRUPersistentCache< K, V, MutexT >::setPersistence().

214  {
216  persistence_ = std::move(persistence);
217  // load the persistence data into memory
218  if (persistence_) {
219  auto version = load(*persistence_);
220  if (syncVersion) {
221  persistence_->setPersistedVersion(version);
222  }
223  }
224 }
std::shared_ptr< CachePersistence< K, V > > persistence_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
ProtocolVersion version
CacheDataVersion load(CachePersistence< K, V > &persistence) noexcept
template<typename K, typename V, typename MutexT = std::mutex>
void wangle::LRUPersistentCache< K, V, MutexT >::setSyncOnDestroy ( bool  syncOnDestroy)
inline

Definition at line 198 of file LRUPersistentCache.h.

Referenced by wangle::FilePersistentCache< K, V, M >::setSyncOnDestroy().

198  {
199  syncOnDestroy_ = syncOnDestroy;
200  }
template<typename K, typename V, typename MutexT = std::mutex>
size_t wangle::LRUPersistentCache< K, V, MutexT >::size ( )
inlineoverridevirtual

return the size of the cache

Returns
size_t, the size of the cache

Implements wangle::PersistentCache< K, V >.

Definition at line 194 of file LRUPersistentCache.h.

Referenced by wangle::FilePersistentCache< K, V, M >::size().

194  {
195  return cache_.size();
196  }
LRUInMemoryCache< K, V, MutexT > cache_
template<typename K , typename V , typename MutexT >
void wangle::LRUPersistentCache< K, V, MutexT >::sync ( )
private

The syncer thread's function. Syncs to the persistence, if necessary, after every syncInterval_ seconds.

Definition at line 146 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::cache_, wangle::LRUPersistentCache< K, V, MutexT >::getPersistence(), wangle::LRUPersistentCache< K, V, MutexT >::nSyncRetries_, wangle::LRUPersistentCache< K, V, MutexT >::stopSyncer_, wangle::LRUPersistentCache< K, V, MutexT >::stopSyncerCV_, wangle::LRUPersistentCache< K, V, MutexT >::stopSyncerMutex_, wangle::LRUPersistentCache< K, V, MutexT >::syncInterval_, and wangle::LRUPersistentCache< K, V, MutexT >::syncNow().

Referenced by wangle::LRUPersistentCache< K, V, MutexT >::syncThreadMain().

146  {
147  // keep running as long the destructor signals to stop or
148  // there are pending updates that are not synced yet
149  std::unique_lock<std::mutex> stopSyncerLock(stopSyncerMutex_);
150  int nSyncFailures = 0;
151  while (true) {
152  auto persistence = getPersistence();
153  if (stopSyncer_) {
154  if (!persistence ||
155  !cache_.hasChangedSince(persistence->getLastPersistedVersion())) {
156  break;
157  }
158  }
159 
160  if (persistence && !syncNow(*persistence)) {
161  // track failures and give up if we tried too many times
162  ++nSyncFailures;
163  if (nSyncFailures == nSyncRetries_) {
164  persistence->setPersistedVersion(cache_.getVersion());
165  nSyncFailures = 0;
166  }
167  } else {
168  nSyncFailures = 0;
169  }
170 
171  if (!stopSyncer_) {
172  stopSyncerCV_.wait_for(stopSyncerLock, syncInterval_);
173  }
174  }
175 }
std::condition_variable stopSyncerCV_
LRUInMemoryCache< K, V, MutexT > cache_
const std::chrono::milliseconds syncInterval_
bool syncNow(CachePersistence< K, V > &persistence)
std::shared_ptr< CachePersistence< K, V > > getPersistence()
template<typename K, typename V, typename MutexT >
bool wangle::LRUPersistentCache< K, V, MutexT >::syncNow ( CachePersistence< K, V > &  persistence)
private

Helper to sync routine above that actualy does the serialization and writes to persistence.

Returns
boolean, true on successful serialization and write to persistence, false otherwise

Definition at line 178 of file LRUPersistentCache-inl.h.

References wangle::LRUPersistentCache< K, V, MutexT >::cache_, wangle::CachePersistence< K, V >::getLastPersistedVersion(), folly::gen::move, wangle::CachePersistence< K, V >::persistVersionedData(), and version.

Referenced by wangle::LRUPersistentCache< K, V, MutexT >::oneShotSync(), and wangle::LRUPersistentCache< K, V, MutexT >::sync().

179  {
180  // check if we need to sync. There is a chance that someone can
181  // update cache_ between this check and the convert below, but that
182  // is ok. The persistence layer would have needed to update anyway
183  // and will just get the latest version.
184  if (!cache_.hasChangedSince(persistence.getLastPersistedVersion())) {
185  // nothing to do
186  return true;
187  }
188 
189  // serialize the current contents of cache under lock
190  auto serializedCacheAndVersion = cache_.convertToKeyValuePairs();
191  if (!serializedCacheAndVersion) {
192  LOG(ERROR) << "Failed to convert cache for serialization.";
193  return false;
194  }
195 
196  auto& kvPairs = std::get<0>(serializedCacheAndVersion.value());
197  auto& version = std::get<1>(serializedCacheAndVersion.value());
198  auto persisted =
199  persistence.persistVersionedData(std::move(kvPairs), version);
200 
201  return persisted;
202 }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
ProtocolVersion version
LRUInMemoryCache< K, V, MutexT > cache_
template<typename K , typename V , typename MutexT >
void * wangle::LRUPersistentCache< K, V, MutexT >::syncThreadMain ( void *  arg)
staticprivate

Definition at line 121 of file LRUPersistentCache-inl.h.

References folly::setThreadName(), and wangle::LRUPersistentCache< K, V, MutexT >::sync().

121  {
122  folly::setThreadName("lru-sync-thread");
123 
124  auto self = static_cast<LRUPersistentCache<K, V, MutexT>*>(arg);
125  self->sync();
126  return nullptr;
127 }
bool setThreadName(std::thread::id tid, StringPiece name)
Definition: ThreadName.cpp:109

Member Data Documentation

template<typename K, typename V, typename MutexT = std::mutex>
std::shared_ptr<folly::Executor> wangle::LRUPersistentCache< K, V, MutexT >::executor_
private
template<typename K, typename V, typename MutexT = std::mutex>
std::atomic_flag wangle::LRUPersistentCache< K, V, MutexT >::executorScheduled_ = ATOMIC_FLAG_INIT
private
template<typename K, typename V, typename MutexT = std::mutex>
std::chrono::steady_clock::time_point wangle::LRUPersistentCache< K, V, MutexT >::lastExecutorScheduleTime_
private
template<typename K, typename V, typename MutexT = std::mutex>
const int wangle::LRUPersistentCache< K, V, MutexT >::nSyncRetries_ {client::persistence::DEFAULT_CACHE_SYNC_RETRIES}
private
template<typename K, typename V, typename MutexT = std::mutex>
int wangle::LRUPersistentCache< K, V, MutexT >::nSyncTries_ {0}
private
template<typename K, typename V, typename MutexT = std::mutex>
std::shared_ptr<CachePersistence<K, V> > wangle::LRUPersistentCache< K, V, MutexT >::persistence_
private
template<typename K, typename V, typename MutexT = std::mutex>
MutexT wangle::LRUPersistentCache< K, V, MutexT >::persistenceLock_
private
template<typename K, typename V, typename MutexT = std::mutex>
bool wangle::LRUPersistentCache< K, V, MutexT >::stopSyncer_ {false}
private
template<typename K, typename V, typename MutexT = std::mutex>
std::condition_variable wangle::LRUPersistentCache< K, V, MutexT >::stopSyncerCV_
private
template<typename K, typename V, typename MutexT = std::mutex>
std::mutex wangle::LRUPersistentCache< K, V, MutexT >::stopSyncerMutex_
private
template<typename K, typename V, typename MutexT = std::mutex>
std::thread wangle::LRUPersistentCache< K, V, MutexT >::syncer_
private
template<typename K, typename V, typename MutexT = std::mutex>
const std::chrono::milliseconds wangle::LRUPersistentCache< K, V, MutexT >::syncInterval_
private
template<typename K, typename V, typename MutexT = std::mutex>
bool wangle::LRUPersistentCache< K, V, MutexT >::syncOnDestroy_ {false}
private

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