CLUSTER KEYSLOT command

This commit is contained in:
antirez 2011-04-29 14:31:18 +02:00
parent d37299e3b7
commit 1eb713a4c1

View File

@ -1205,6 +1205,10 @@ void clusterCommand(redisClient *c) {
(unsigned long)sdslen(info)));
addReplySds(c,info);
addReply(c,shared.crlf);
} else if (!strcasecmp(c->argv[1]->ptr,"keyslot") && c->argc == 3) {
sds key = c->argv[2]->ptr;
addReplyLongLong(c,keyHashSlot(key,sdslen(key)));
} else {
addReplyError(c,"Wrong CLUSTER subcommand or number of arguments");
}