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

Function snapshot_scan_callback

src/snapshot.cpp:498–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496 list *keys;
497};
498void snapshot_scan_callback(void *privdata, const dictEntry *de)
499{
500 scan_callback_data *data = (scan_callback_data*)privdata;
501 if (data->dictTombstone != nullptr && dictFind(data->dictTombstone, dictGetKey(de)) != nullptr)
502 return;
503
504 sds sdskey = (sds)dictGetKey(de);
505 if (data->type != nullptr)
506 {
507 if (strcasecmp(data->type, getObjectTypeName((robj*)dictGetVal(de))) != 0)
508 return;
509 }
510 listAddNodeHead(data->keys, createStringObject(sdskey, sdslen(sdskey)));
511}
512unsigned long redisDbPersistentDataSnapshot::scan_threadsafe(unsigned long iterator, long count, sds type, list *keys) const
513{
514 unsigned long iteratorReturn = 0;

Callers

nothing calls this directly

Calls 5

getObjectTypeNameFunction · 0.85
listAddNodeHeadFunction · 0.85
sdslenFunction · 0.85
dictFindFunction · 0.70
createStringObjectFunction · 0.70

Tested by

no test coverage detected