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

Method emptyDbAsync

src/lazyfree.cpp:217–227  ·  view source on GitHub ↗

Empty a Redis DB asynchronously. What the function does actually is to * create a new empty set of hash tables and scheduling the old ones for * lazy freeing. */

Source from the content-addressed store, hash-verified

215 * create a new empty set of hash tables and scheduling the old ones for
216 * lazy freeing. */
217void redisDbPersistentData::emptyDbAsync() {
218 dict *oldht1 = m_pdict;
219 m_pdict = dictCreate(&dbDictType,this);
220 if (m_spstorage != nullptr)
221 m_spstorage->clearAsync();
222 if (m_fTrackingChanges)
223 m_fAllChanged = true;
224 atomicIncr(lazyfree_objects,dictSize(oldht1));
225 m_numexpires = 0;
226 bioCreateLazyFreeJob(lazyfreeFreeDatabase,2,oldht1,nullptr);
227}
228
229/* Release the radix tree mapping Redis Cluster keys to slots asynchronously. */
230void freeSlotsToKeysMapAsync(rax *rt) {

Callers

nothing calls this directly

Calls 3

bioCreateLazyFreeJobFunction · 0.85
clearAsyncMethod · 0.80
dictCreateFunction · 0.70

Tested by

no test coverage detected