Populates the KeyDB Command Table starting from the hard coded list * we have on top of server.cpp file. */
| 4226 | /* Populates the KeyDB Command Table starting from the hard coded list |
| 4227 | * we have on top of server.cpp file. */ |
| 4228 | void populateCommandTable(void) { |
| 4229 | int j; |
| 4230 | int numcommands = sizeof(redisCommandTable)/sizeof(struct redisCommand); |
| 4231 | |
| 4232 | for (j = 0; j < numcommands; j++) { |
| 4233 | struct redisCommand *c = redisCommandTable+j; |
| 4234 | int retval1, retval2; |
| 4235 | |
| 4236 | /* Translate the command string flags description into an actual |
| 4237 | * set of flags. */ |
| 4238 | if (populateCommandTableParseFlags(c,c->sflags) == C_ERR) |
| 4239 | serverPanic("Unsupported command flag"); |
| 4240 | |
| 4241 | c->id = ACLGetCommandID(c->name); /* Assign the ID used for ACL. */ |
| 4242 | retval1 = dictAdd(g_pserver->commands, sdsnew(c->name), c); |
| 4243 | /* Populate an additional dictionary that will be unaffected |
| 4244 | * by rename-command statements in keydb.conf. */ |
| 4245 | retval2 = dictAdd(g_pserver->orig_commands, sdsnew(c->name), c); |
| 4246 | serverAssert(retval1 == DICT_OK && retval2 == DICT_OK); |
| 4247 | } |
| 4248 | } |
| 4249 | |
| 4250 | void resetCommandTableStats(void) { |
| 4251 | struct redisCommand *c; |
no test coverage detected