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

Function clusterManagerPrintSlotsList

src/redis-cli.c:4063–4076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4061}
4062
4063void clusterManagerPrintSlotsList(list *slots) {
4064 clusterManagerNode n = {0};
4065 listIter li;
4066 listNode *ln;
4067 listRewind(slots, &li);
4068 while ((ln = listNext(&li)) != NULL) {
4069 int slot = atoi(ln->value);
4070 if (slot >= 0 && slot < CLUSTER_MANAGER_SLOTS)
4071 n.slots[slot] = 1;
4072 }
4073 sds nodeslist = clusterManagerNodeSlotsString(&n);
4074 printf("%s\n", nodeslist);
4075 sdsfree(nodeslist);
4076}
4077
4078/* Return the node, among 'nodes' with the greatest number of keys
4079 * in the specified slot. */

Callers 1

Calls 4

listRewindFunction · 0.85
listNextFunction · 0.85
sdsfreeFunction · 0.85

Tested by

no test coverage detected