mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Cluster: add comments in sub-sections of CLUSTER command.
This commit is contained in:
parent
96dd210970
commit
2dcb5ab72b
@ -1543,6 +1543,7 @@ void clusterCommand(redisClient *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!strcasecmp(c->argv[1]->ptr,"meet") && c->argc == 4) {
|
if (!strcasecmp(c->argv[1]->ptr,"meet") && c->argc == 4) {
|
||||||
|
/* CLUSTER MEET <ip> <port> */
|
||||||
clusterNode *n;
|
clusterNode *n;
|
||||||
struct sockaddr_in sa;
|
struct sockaddr_in sa;
|
||||||
long port;
|
long port;
|
||||||
@ -1567,6 +1568,7 @@ void clusterCommand(redisClient *c) {
|
|||||||
clusterAddNode(n);
|
clusterAddNode(n);
|
||||||
addReply(c,shared.ok);
|
addReply(c,shared.ok);
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"nodes") && c->argc == 2) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"nodes") && c->argc == 2) {
|
||||||
|
/* CLUSTER NODES */
|
||||||
robj *o;
|
robj *o;
|
||||||
sds ci = clusterGenNodesDescription();
|
sds ci = clusterGenNodesDescription();
|
||||||
|
|
||||||
@ -1699,6 +1701,7 @@ void clusterCommand(redisClient *c) {
|
|||||||
clusterSaveConfigOrDie();
|
clusterSaveConfigOrDie();
|
||||||
addReply(c,shared.ok);
|
addReply(c,shared.ok);
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"info") && c->argc == 2) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"info") && c->argc == 2) {
|
||||||
|
/* CLUSTER INFO */
|
||||||
char *statestr[] = {"ok","fail","needhelp"};
|
char *statestr[] = {"ok","fail","needhelp"};
|
||||||
int slots_assigned = 0, slots_ok = 0, slots_pfail = 0, slots_fail = 0;
|
int slots_assigned = 0, slots_ok = 0, slots_pfail = 0, slots_fail = 0;
|
||||||
int j;
|
int j;
|
||||||
@ -1738,10 +1741,12 @@ void clusterCommand(redisClient *c) {
|
|||||||
addReplySds(c,info);
|
addReplySds(c,info);
|
||||||
addReply(c,shared.crlf);
|
addReply(c,shared.crlf);
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"keyslot") && c->argc == 3) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"keyslot") && c->argc == 3) {
|
||||||
|
/* CLUSTER KEYSLOT <key> */
|
||||||
sds key = c->argv[2]->ptr;
|
sds key = c->argv[2]->ptr;
|
||||||
|
|
||||||
addReplyLongLong(c,keyHashSlot(key,sdslen(key)));
|
addReplyLongLong(c,keyHashSlot(key,sdslen(key)));
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"countkeysinslot") && c->argc == 3) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"countkeysinslot") && c->argc == 3) {
|
||||||
|
/* CLUSTER COUNTKEYSINSLOT <slot> */
|
||||||
long long slot;
|
long long slot;
|
||||||
|
|
||||||
if (getLongLongFromObjectOrReply(c,c->argv[2],&slot,NULL) != REDIS_OK)
|
if (getLongLongFromObjectOrReply(c,c->argv[2],&slot,NULL) != REDIS_OK)
|
||||||
@ -1752,6 +1757,7 @@ void clusterCommand(redisClient *c) {
|
|||||||
}
|
}
|
||||||
addReplyLongLong(c,countKeysInSlot(slot));
|
addReplyLongLong(c,countKeysInSlot(slot));
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"getkeysinslot") && c->argc == 4) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"getkeysinslot") && c->argc == 4) {
|
||||||
|
/* CLUSTER GETKEYSINSLOT <slot> <count> */
|
||||||
long long maxkeys, slot;
|
long long maxkeys, slot;
|
||||||
unsigned int numkeys, j;
|
unsigned int numkeys, j;
|
||||||
robj **keys;
|
robj **keys;
|
||||||
|
Loading…
Reference in New Issue
Block a user