Implements Sentinel version of the ROLE command. The output is * "sentinel" and the list of currently monitored master names. */
| 3969 | /* Implements Sentinel version of the ROLE command. The output is |
| 3970 | * "sentinel" and the list of currently monitored master names. */ |
| 3971 | void sentinelRoleCommand(client *c) { |
| 3972 | dictIterator *di; |
| 3973 | dictEntry *de; |
| 3974 | |
| 3975 | addReplyArrayLen(c,2); |
| 3976 | addReplyBulkCBuffer(c,"sentinel",8); |
| 3977 | addReplyArrayLen(c,dictSize(sentinel.masters)); |
| 3978 | |
| 3979 | di = dictGetIterator(sentinel.masters); |
| 3980 | while((de = dictNext(di)) != NULL) { |
| 3981 | sentinelRedisInstance *ri = dictGetVal(de); |
| 3982 | |
| 3983 | addReplyBulkCString(c,ri->name); |
| 3984 | } |
| 3985 | dictReleaseIterator(di); |
| 3986 | } |
| 3987 | |
| 3988 | /* SENTINEL SET <mastername> [<option> <value> ...] */ |
| 3989 | void sentinelSetCommand(client *c) { |
nothing calls this directly
no test coverage detected