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

Function defragLater

src/defrag.cpp:461–464  ·  view source on GitHub ↗

when the value has lots of elements, we want to handle it later and not as * part of the main dictionary scan. this is needed in order to prevent latency * spikes when handling large items */

Source from the content-addressed store, hash-verified

459 * part of the main dictionary scan. this is needed in order to prevent latency
460 * spikes when handling large items */
461void defragLater(redisDb *db, dictEntry *kde) {
462 sds key = sdsdup((sds)dictGetKey(kde));
463 listAddNodeTail(db->defrag_later, key);
464}
465
466/* returns 0 if no more work needs to be been done, and 1 if time is up and more work is needed. */
467long scanLaterList(robj *ob, unsigned long *cursor, long long endtime, long long *defragged) {

Callers 6

defragQuicklistFunction · 0.85
defragZsetSkiplistFunction · 0.85
defragHashFunction · 0.85
defragSetFunction · 0.85
defragStreamFunction · 0.85
defragModuleFunction · 0.85

Calls 2

sdsdupFunction · 0.85
listAddNodeTailFunction · 0.85

Tested by

no test coverage detected