MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sentinelRoleCommand

Function sentinelRoleCommand

app/redis-6.2.6/src/sentinel.c:3971–3986  ·  view source on GitHub ↗

Implements Sentinel version of the ROLE command. The output is * "sentinel" and the list of currently monitored master names. */

Source from the content-addressed store, hash-verified

3969/* Implements Sentinel version of the ROLE command. The output is
3970 * "sentinel" and the list of currently monitored master names. */
3971void 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> ...] */
3989void sentinelSetCommand(client *c) {

Callers

nothing calls this directly

Calls 6

addReplyArrayLenFunction · 0.85
addReplyBulkCBufferFunction · 0.85
addReplyBulkCStringFunction · 0.85
dictGetIteratorFunction · 0.70
dictNextFunction · 0.70
dictReleaseIteratorFunction · 0.70

Tested by

no test coverage detected