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

Method commitChanges

src/db.cpp:3029–3047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3027}
3028
3029void redisDbPersistentData::commitChanges(const redisDbPersistentDataSnapshot **psnapshotFree)
3030{
3031 if (m_pdbSnapshotStorageFlush)
3032 {
3033 dictIterator *di = dictGetIterator(m_dictChangedStorageFlush);
3034 dictEntry *de;
3035 while ((de = dictNext(di)) != nullptr)
3036 {
3037 serializeAndStoreChange(m_spstorage.get(), (redisDbPersistentData*)m_pdbSnapshotStorageFlush, (const char*)dictGetKey(de), (bool)dictGetVal(de));
3038 }
3039 dictReleaseIterator(di);
3040 dictRelease(m_dictChangedStorageFlush);
3041 m_dictChangedStorageFlush = nullptr;
3042 *psnapshotFree = m_pdbSnapshotStorageFlush;
3043 m_pdbSnapshotStorageFlush = nullptr;
3044 }
3045 if (m_spstorage != nullptr)
3046 m_spstorage->endWriteBatch();
3047}
3048
3049redisDbPersistentData::~redisDbPersistentData()
3050{

Callers 7

rdbLoadRioFunction · 0.80
readSnapshotBulkPayloadFunction · 0.80
flushStorageWeakFunction · 0.80
beforeSleepFunction · 0.80
prepareForShutdownFunction · 0.80
debugCommandFunction · 0.80
loadAppendOnlyFileFunction · 0.80

Calls 6

dictGetIteratorFunction · 0.70
dictNextFunction · 0.70
dictReleaseIteratorFunction · 0.70
dictReleaseFunction · 0.70
getMethod · 0.45
endWriteBatchMethod · 0.45

Tested by

no test coverage detected