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

Function streamLookupCG

src/t_stream.cpp:2291–2296  ·  view source on GitHub ↗

Lookup the consumer group in the specified stream and returns its * pointer, otherwise if there is no such group, NULL is returned. */

Source from the content-addressed store, hash-verified

2289/* Lookup the consumer group in the specified stream and returns its
2290 * pointer, otherwise if there is no such group, NULL is returned. */
2291streamCG *streamLookupCG(stream *s, sds groupname) {
2292 if (s->cgroups == NULL) return NULL;
2293 streamCG *cg = (streamCG*)raxFind(s->cgroups,(unsigned char*)groupname,
2294 sdslen(groupname));
2295 return (cg == raxNotFound) ? NULL : cg;
2296}
2297
2298/* Lookup the consumer with the specified name in the group 'cg': if the
2299 * consumer does not exist it is created unless SLC_NOCREAT flag was specified.

Callers 8

xreadCommandFunction · 0.85
xgroupCommandFunction · 0.85
xackCommandFunction · 0.85
xpendingCommandFunction · 0.85
xclaimCommandFunction · 0.85
xautoclaimCommandFunction · 0.85
xinfoCommandFunction · 0.85

Calls 2

raxFindFunction · 0.85
sdslenFunction · 0.85

Tested by

no test coverage detected