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

Method retrieve

src/StorageCache.cpp:196–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196void StorageCache::retrieve(sds key, IStorage::callbackSingle fn) const
197{
198 std::unique_lock<fastlock> ul(m_lock);
199 if (m_pdict != nullptr)
200 {
201 uint64_t hash = dictSdsHash(key);
202 dictEntry *de = dictFind(m_pdict, reinterpret_cast<void*>(hash));
203
204 if (de == nullptr)
205 return; // Not found
206 }
207 ul.unlock();
208 m_spstorage->retrieve(key, sdslen(key), fn);
209}
210
211size_t StorageCache::count() const
212{

Callers 5

ensureMethod · 0.45
prefetchKeysAsyncMethod · 0.45
eraseMethod · 0.45
initServerFunction · 0.45
debugCommandFunction · 0.45

Calls 4

sdslenFunction · 0.85
dictSdsHashFunction · 0.70
dictFindFunction · 0.70
unlockMethod · 0.45

Tested by

no test coverage detected