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

Function slotToKeyFlush

src/db.cpp:2517–2524  ·  view source on GitHub ↗

Empty the slots-keys map of Redis CLuster by creating a new empty one and * freeing the old one. */

Source from the content-addressed store, hash-verified

2515/* Empty the slots-keys map of Redis CLuster by creating a new empty one and
2516 * freeing the old one. */
2517void slotToKeyFlush(int async) {
2518 rax *old = g_pserver->cluster->slots_to_keys;
2519
2520 g_pserver->cluster->slots_to_keys = raxNew();
2521 memset(g_pserver->cluster->slots_keys_count,0,
2522 sizeof(g_pserver->cluster->slots_keys_count));
2523 freeSlotsToKeysMap(old, async);
2524}
2525
2526/* Populate the specified array of objects with keys in the specified slot.
2527 * New objects are returned to represent keys, it's up to the caller to

Callers 1

emptyDbFunction · 0.85

Calls 2

raxNewFunction · 0.85
freeSlotsToKeysMapFunction · 0.85

Tested by

no test coverage detected