Concatenate the comma separated list of node flags to the given SDS * string 'ci'. */
| 4210 | /* Concatenate the comma separated list of node flags to the given SDS |
| 4211 | * string 'ci'. */ |
| 4212 | sds representClusterNodeFlags(sds ci, uint16_t flags) { |
| 4213 | size_t orig_len = sdslen(ci); |
| 4214 | int i, size = sizeof(redisNodeFlagsTable)/sizeof(struct redisNodeFlags); |
| 4215 | for (i = 0; i < size; i++) { |
| 4216 | struct redisNodeFlags *nodeflag = redisNodeFlagsTable + i; |
| 4217 | if (flags & nodeflag->flag) ci = sdscat(ci, nodeflag->name); |
| 4218 | } |
| 4219 | /* If no flag was added, add the "noflags" special flag. */ |
| 4220 | if (sdslen(ci) == orig_len) ci = sdscat(ci,"noflags,"); |
| 4221 | sdsIncrLen(ci,-1); /* Remove trailing comma. */ |
| 4222 | return ci; |
| 4223 | } |
| 4224 | |
| 4225 | /* Generate a csv-alike representation of the specified cluster node. |
| 4226 | * See clusterGenNodesDescription() top comment for more information. |
no test coverage detected