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

Method create

fdbserver/VersionedBTree.actor.cpp:1128–1148  ·  view source on GitHub ↗

Create a new queue at newPageID

Source from the content-addressed store, hash-verified

1126
1127 // Create a new queue at newPageID
1128 void create(IPager2* p, PhysicalPageID newPageID, std::string queueName, QueueID id, bool extent) {
1129 debug_printf("FIFOQueue(%s) create from page %s. usesExtents %d\n",
1130 queueName.c_str(),
1131 toString(newPageID).c_str(),
1132 extent);
1133 pager = p;
1134 pagerError = pager->getError();
1135 name = queueName;
1136 queueID = id;
1137 numPages = 1;
1138 numEntries = 0;
1139 usesExtents = extent;
1140 tailPageNewExtent = false;
1141 prevExtentEndPageID = invalidPhysicalPageID;
1142 pagesPerExtent = pager->getPagesPerExtent();
1143 headReader.init(this, Cursor::POP, newPageID, false, false, newPageID, 0);
1144 tailWriter.init(this, Cursor::WRITE, newPageID, true, true);
1145 headWriter.init(this, Cursor::WRITE);
1146 newTailPage = invalidPhysicalPageID;
1147 debug_printf("FIFOQueue(%s) created\n", queueName.c_str());
1148 }
1149
1150 // Load an existing queue from its queue state
1151 void recover(IPager2* p, const QueueState& qs, std::string queueName, bool loadExtents = true) {

Callers

nothing calls this directly

Calls 4

toStringFunction · 0.70
c_strMethod · 0.45
getErrorMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected