MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / count

Method count

src/StorageCache.cpp:211–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211size_t StorageCache::count() const
212{
213 std::unique_lock<fastlock> ul(m_lock, std::defer_lock);
214 bool fLocked = ul.try_lock();
215 size_t count = m_spstorage->count();
216 if (m_pdict != nullptr && fLocked) {
217 serverAssert(bulkInsertsInProgress.load(std::memory_order_seq_cst) || count == (dictSize(m_pdict) + m_collisionCount));
218 }
219 return count;
220}
221
222void StorageCache::beginWriteBatch() {
223 serverAssert(GlobalLocksAcquired()); // Otherwise we deadlock

Callers 4

storeDatabaseMethod · 0.45
processChangesMethod · 0.45
sizeMethod · 0.45
syncWithMasterFunction · 0.45

Calls 1

try_lockMethod · 0.45

Tested by

no test coverage detected