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

Function streamDeleteItem

src/t_stream.cpp:1320–1332  ·  view source on GitHub ↗

Delete the specified item ID from the stream, returning 1 if the item * was deleted 0 otherwise (if it does not exist). */

Source from the content-addressed store, hash-verified

1318/* Delete the specified item ID from the stream, returning 1 if the item
1319 * was deleted 0 otherwise (if it does not exist). */
1320int streamDeleteItem(stream *s, streamID *id) {
1321 int deleted = 0;
1322 streamIterator si;
1323 streamIteratorStart(&si,s,id,id,0);
1324 streamID myid;
1325 int64_t numfields;
1326 if (streamIteratorGetID(&si,&myid,&numfields)) {
1327 streamIteratorRemoveEntry(&si,&myid);
1328 deleted = 1;
1329 }
1330 streamIteratorStop(&si);
1331 return deleted;
1332}
1333
1334/* Get the last valid (non-tombstone) streamID of 's'. */
1335void streamLastValidID(stream *s, streamID *maxid)

Callers 2

xdelCommandFunction · 0.85
RM_StreamDeleteFunction · 0.85

Calls 4

streamIteratorStartFunction · 0.85
streamIteratorGetIDFunction · 0.85
streamIteratorStopFunction · 0.85

Tested by

no test coverage detected