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

Function rioWriteBulkObject

src/aof.cpp:1078–1088  ·  view source on GitHub ↗

Delegate writing an object to writing a bulk string or bulk long long. * This is not placed in rio.c since that adds the g_pserver->h dependency. */

Source from the content-addressed store, hash-verified

1076/* Delegate writing an object to writing a bulk string or bulk long long.
1077 * This is not placed in rio.c since that adds the g_pserver->h dependency. */
1078int rioWriteBulkObject(rio *r, robj *obj) {
1079 /* Avoid using getDecodedObject to help copy-on-write (we are often
1080 * in a child process when this function is called). */
1081 if (obj->encoding == OBJ_ENCODING_INT) {
1082 return rioWriteBulkLongLong(r,(long)obj->m_ptr);
1083 } else if (sdsEncodedObject(obj)) {
1084 return rioWriteBulkString(r,szFromObj(obj),sdslen(szFromObj(obj)));
1085 } else {
1086 serverPanic("Unknown string encoding");
1087 }
1088}
1089
1090/* Emit the commands needed to rebuild a list object.
1091 * The function returns 0 on error, 1 on success. */

Callers 9

RM_EmitAOFFunction · 0.85
rewriteListObjectFunction · 0.85
rewriteSetObjectFunction · 0.85
rewriteSortedSetObjectFunction · 0.85
rewriteHashObjectFunction · 0.85
rewriteStreamObjectFunction · 0.85
rewriteAppendOnlyFileRioFunction · 0.85

Calls 4

rioWriteBulkLongLongFunction · 0.85
rioWriteBulkStringFunction · 0.85
szFromObjFunction · 0.85
sdslenFunction · 0.85

Tested by

no test coverage detected