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

Function RM_ResetDataset

src/module.cpp:2512–2516  ·  view source on GitHub ↗

Performs similar operation to FLUSHALL, and optionally start a new AOF file (if enabled) * If restart_aof is true, you must make sure the command that triggered this call is not * propagated to the AOF file. * When async is set to true, db contents will be freed by a background thread. */

Source from the content-addressed store, hash-verified

2510 * propagated to the AOF file.
2511 * When async is set to true, db contents will be freed by a background thread. */
2512void RM_ResetDataset(int restart_aof, int async) {
2513 if (restart_aof && g_pserver->aof_state != AOF_OFF) stopAppendOnly();
2514 flushAllDataAndResetRDB(async? EMPTYDB_ASYNC: EMPTYDB_NO_FLAGS);
2515 if (g_pserver->aof_enabled && restart_aof) restartAOFAfterSYNC();
2516}
2517
2518/* Returns the number of keys in the current db. */
2519unsigned long long RM_DbSize(RedisModuleCtx *ctx) {

Callers

nothing calls this directly

Calls 3

stopAppendOnlyFunction · 0.85
flushAllDataAndResetRDBFunction · 0.85
restartAOFAfterSYNCFunction · 0.85

Tested by

no test coverage detected