MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dbAddRDBLoad

Function dbAddRDBLoad

app/redis-6.2.6/src/db.c:213–218  ·  view source on GitHub ↗

This is a special version of dbAdd() that is used only when loading * keys from the RDB file: the key is passed as an SDS string that is * retained by the function (and not freed by the caller). * * Moreover this function will not abort if the key is already busy, to * give more control to the caller, nor will signal the key as ready * since it is not useful in this context. * * The functi

Source from the content-addressed store, hash-verified

211 * ownership of the SDS string, otherwise 0 is returned, and is up to the
212 * caller to free the SDS string. */
213int dbAddRDBLoad(redisDb *db, sds key, robj *val) {
214 int retval = dictAdd(db->dict, key, val);
215 if (retval != DICT_OK) return 0;
216 if (server.cluster_enabled) slotToKeyAdd(key);
217 return 1;
218}
219
220/* Overwrite an existing key with a new value. Incrementing the reference
221 * count of the new value is up to the caller.

Callers 1

rdbLoadRioFunction · 0.85

Calls 2

slotToKeyAddFunction · 0.85
dictAddFunction · 0.70

Tested by

no test coverage detected