MCPcopy Create free account
hub / github.com/apple/foundationdb / getUsedExtents_impl

Function getUsedExtents_impl

fdbserver/VersionedBTree.actor.cpp:2569–2586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2567
2568 // get a list of used extents for a given extent based queue (for testing purpose)
2569 ACTOR static Future<Standalone<VectorRef<LogicalPageID>>> getUsedExtents_impl(DWALPager* self, QueueID queueID) {
2570 state Standalone<VectorRef<LogicalPageID>> extentIDs;
2571 extentIDs.reserve(extentIDs.arena(),
2572 self->extentUsedList.numEntries); // TODO this is overreserving. is that a problem?
2573
2574 Standalone<VectorRef<ExtentUsedListEntry>> extents = wait(self->extentUsedList.peekAll());
2575 debug_printf("DWALPager(%s) ExtentUsedList size: %d.\n", self->filename.c_str(), extents.size());
2576 if (extents.size() > 1) {
2577 for (int i = 1; i < extents.size() - 1; i++) {
2578 if (extents[i].queueID == queueID) {
2579 LogicalPageID extID = extents[i].extentID;
2580 debug_printf("DWALPager Extents: ID: %s ", toString(extID).c_str());
2581 extentIDs.push_back(extentIDs.arena(), extID);
2582 }
2583 }
2584 }
2585 return extentIDs;
2586 }
2587
2588 Future<Standalone<VectorRef<LogicalPageID>>> getUsedExtents(QueueID queueID) override {
2589 return getUsedExtents_impl(this, queueID);

Callers 1

getUsedExtentsFunction · 0.85

Calls 6

peekAllMethod · 0.80
toStringFunction · 0.70
reserveMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected