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

Function dumpCommand

src/cluster.cpp:5187–5203  ·  view source on GitHub ↗

DUMP keyname * DUMP is actually not used by Redis Cluster but it is the obvious * complement of RESTORE and can be useful for different applications. */

Source from the content-addressed store, hash-verified

5185 * DUMP is actually not used by Redis Cluster but it is the obvious
5186 * complement of RESTORE and can be useful for different applications. */
5187void dumpCommand(client *c) {
5188 robj_roptr o;
5189 rio payload;
5190
5191 /* Check if the key is here. */
5192 if ((o = lookupKeyRead(c->db,c->argv[1])) == nullptr) {
5193 addReplyNull(c);
5194 return;
5195 }
5196
5197 /* Create the DUMP encoded representation. */
5198 createDumpPayload(&payload,o,c->argv[1]);
5199
5200 /* Transfer to the client */
5201 addReplyBulkSds(c,payload.io.buffer.ptr);
5202 return;
5203}
5204
5205/* KEYDB.MVCCRESTORE key mvcc expire serialized-value */
5206void mvccrestoreCommand(client *c) {

Callers

nothing calls this directly

Calls 4

lookupKeyReadFunction · 0.85
addReplyNullFunction · 0.85
createDumpPayloadFunction · 0.85
addReplyBulkSdsFunction · 0.85

Tested by

no test coverage detected