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

Function rewriteModuleObject

src/aof.cpp:1522–1533  ·  view source on GitHub ↗

Call the module type callback in order to rewrite a data type * that is exported by a module and is not handled by Redis itself. * The function returns 0 on error, 1 on success. */

Source from the content-addressed store, hash-verified

1520 * that is exported by a module and is not handled by Redis itself.
1521 * The function returns 0 on error, 1 on success. */
1522int rewriteModuleObject(rio *r, robj *key, robj *o) {
1523 RedisModuleIO io;
1524 moduleValue *mv = (moduleValue*)ptrFromObj(o);
1525 moduleType *mt = mv->type;
1526 moduleInitIOContext(io,mt,r,key);
1527 mt->aof_rewrite(&io,key,mv->value);
1528 if (io.ctx) {
1529 moduleFreeContext(io.ctx);
1530 zfree(io.ctx);
1531 }
1532 return io.error ? 0 : 1;
1533}
1534
1535/* This function is called by the child rewriting the AOF file to read
1536 * the difference accumulated from the parent into a buffer, that is

Callers 1

rewriteAppendOnlyFileRioFunction · 0.85

Calls 3

ptrFromObjFunction · 0.85
moduleFreeContextFunction · 0.85
zfreeFunction · 0.85

Tested by

no test coverage detected