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

Function defragStreamConsumer

src/defrag.cpp:770–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770void* defragStreamConsumer(raxIterator *ri, void *privdata, long *defragged) {
771 streamConsumer *c = (streamConsumer*)ri->data;
772 streamCG *cg = (streamCG*)privdata;
773 void *newc = activeDefragAlloc(c);
774 if (newc) {
775 /* note: we don't increment 'defragged' that's done by the caller */
776 c = (streamConsumer*)newc;
777 }
778 sds newsds = activeDefragSds(c->name);
779 if (newsds)
780 (*defragged)++, c->name = newsds;
781 if (c->pel) {
782 PendingEntryContext pel_ctx = {cg, c};
783 *defragged += defragRadixTree(&c->pel, 0, defragStreamConsumerPendingEntry, &pel_ctx);
784 }
785 return newc; /* returns NULL if c was not defragged */
786}
787
788void* defragStreamConsumerGroup(raxIterator *ri, void *privdata, long *defragged) {
789 streamCG *cg = (streamCG*)ri->data;

Callers

nothing calls this directly

Calls 3

activeDefragAllocFunction · 0.85
activeDefragSdsFunction · 0.85
defragRadixTreeFunction · 0.85

Tested by

no test coverage detected