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

Function defragStreamConsumerPendingEntry

src/defrag.cpp:754–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

752} PendingEntryContext;
753
754void* defragStreamConsumerPendingEntry(raxIterator *ri, void *privdata, long *defragged) {
755 UNUSED(defragged);
756 PendingEntryContext *ctx = (PendingEntryContext*)privdata;
757 streamNACK *nack = (streamNACK*)ri->data, *newnack;
758 nack->consumer = ctx->c; /* update nack pointer to consumer */
759 newnack = (streamNACK*)activeDefragAlloc(nack);
760 if (newnack) {
761 /* update consumer group pointer to the nack */
762 void *prev;
763 raxInsert(ctx->cg->pel, ri->key, ri->key_len, newnack, &prev);
764 serverAssert(prev==nack);
765 /* note: we don't increment 'defragged' that's done by the caller */
766 }
767 return newnack;
768}
769
770void* defragStreamConsumer(raxIterator *ri, void *privdata, long *defragged) {
771 streamConsumer *c = (streamConsumer*)ri->data;

Callers

nothing calls this directly

Calls 2

activeDefragAllocFunction · 0.85
raxInsertFunction · 0.85

Tested by

no test coverage detected