Concatenate the comma separated list of node flags to the given SDS * string 'ci'. */
| 4151 | /* Concatenate the comma separated list of node flags to the given SDS |
| 4152 | * string 'ci'. */ |
| 4153 | sds representClusterNodeFlags(sds ci, uint16_t flags) { |
| 4154 | size_t orig_len = sdslen(ci); |
| 4155 | int i, size = sizeof(redisNodeFlagsTable)/sizeof(struct redisNodeFlags); |
| 4156 | for (i = 0; i < size; i++) { |
| 4157 | struct redisNodeFlags *nodeflag = redisNodeFlagsTable + i; |
| 4158 | if (flags & nodeflag->flag) ci = sdscat(ci, nodeflag->name); |
| 4159 | } |
| 4160 | /* If no flag was added, add the "noflags" special flag. */ |
| 4161 | if (sdslen(ci) == orig_len) ci = sdscat(ci,"noflags,"); |
| 4162 | sdsIncrLen(ci,-1); /* Remove trailing comma. */ |
| 4163 | return ci; |
| 4164 | } |
| 4165 | |
| 4166 | /* Generate a csv-alike representation of the specified cluster node. |
| 4167 | * See clusterGenNodesDescription() top comment for more information. |
no test coverage detected