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

Function clusterManagerNodeFlagString

src/redis-cli.c:2761–2776  ·  view source on GitHub ↗

Return a representable string of the node's flags */

Source from the content-addressed store, hash-verified

2759
2760/* Return a representable string of the node's flags */
2761static sds clusterManagerNodeFlagString(clusterManagerNode *node) {
2762 sds flags = sdsempty();
2763 if (!node->flags_str) return flags;
2764 int empty = 1;
2765 listIter li;
2766 listNode *ln;
2767 listRewind(node->flags_str, &li);
2768 while ((ln = listNext(&li)) != NULL) {
2769 sds flag = ln->value;
2770 if (strcmp(flag, "myself") == 0) continue;
2771 if (!empty) flags = sdscat(flags, ",");
2772 flags = sdscatfmt(flags, "%S", flag);
2773 empty = 0;
2774 }
2775 return flags;
2776}
2777
2778/* Return a representable string of the node's slots */
2779static sds clusterManagerNodeSlotsString(clusterManagerNode *node) {

Callers 2

clusterManagerNodeInfoFunction · 0.85

Calls 5

sdsemptyFunction · 0.85
listRewindFunction · 0.85
listNextFunction · 0.85
sdscatFunction · 0.85
sdscatfmtFunction · 0.85

Tested by

no test coverage detected