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

Function streamLastValidID

src/t_stream.cpp:1335–1343  ·  view source on GitHub ↗

Get the last valid (non-tombstone) streamID of 's'. */

Source from the content-addressed store, hash-verified

1333
1334/* Get the last valid (non-tombstone) streamID of 's'. */
1335void streamLastValidID(stream *s, streamID *maxid)
1336{
1337 streamIterator si;
1338 streamIteratorStart(&si,s,NULL,NULL,1);
1339 int64_t numfields;
1340 if (!streamIteratorGetID(&si,maxid,&numfields) && s->length)
1341 serverPanic("Corrupt stream, length is %llu, but no max id", (unsigned long long)s->length);
1342 streamIteratorStop(&si);
1343}
1344
1345/* Emit a reply in the client output buffer by formatting a Stream ID
1346 * in the standard <ms>-<seq> format, using the simple string protocol

Callers 2

xreadCommandFunction · 0.85
xsetidCommandFunction · 0.85

Calls 3

streamIteratorStartFunction · 0.85
streamIteratorGetIDFunction · 0.85
streamIteratorStopFunction · 0.85

Tested by

no test coverage detected