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

Function getKeysFromCommand

src/db.cpp:2198–2206  ·  view source on GitHub ↗

Return all the arguments that are keys in the command passed via argc / argv. * * The command returns the positions of all the key arguments inside the array, * so the actual return value is a heap allocated array of integers. The * length of the array is returned by reference into *numkeys. * * 'cmd' must be point to the corresponding entry into the redisCommand * table, according to the c

Source from the content-addressed store, hash-verified

2196 * This function uses the command table if a command-specific helper function
2197 * is not required, otherwise it calls the command-specific function. */
2198int getKeysFromCommand(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result) {
2199 if (cmd->flags & CMD_MODULE_GETKEYS) {
2200 return moduleGetCommandKeysViaAPI(cmd,argv,argc,result);
2201 } else if (!(cmd->flags & CMD_MODULE) && cmd->getkeys_proc) {
2202 return cmd->getkeys_proc(cmd,argv,argc,result);
2203 } else {
2204 return getKeysUsingCommandTable(cmd,argv,argc,result);
2205 }
2206}
2207
2208/* Free the result of getKeysFromCommand. */
2209void getKeysFreeResult(getKeysResult *result) {

Callers 7

prefetchKeysAsyncMethod · 0.85
getNodeByQueryFunction · 0.85
trackingRememberKeysFunction · 0.85
processCommandFunction · 0.85
commandCommandFunction · 0.85
RM_GetCommandKeysFunction · 0.85
ACLCheckCommandPermFunction · 0.85

Calls 2

getKeysUsingCommandTableFunction · 0.85

Tested by

no test coverage detected