MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getAPPageIdxNoLock

Method getAPPageIdxNoLock

src/storage/disk_array.cpp:177–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177page_idx_t DiskArrayInternal::getAPPageIdxNoLock(page_idx_t apIdx, TransactionType trxType) {
178 auto [pipIdx, offsetInPIP] = StorageUtils::getQuotientRemainder(apIdx, NUM_PAGE_IDXS_PER_PIP);
179 if ((trxType != TransactionType::CHECKPOINT) || !hasPIPUpdatesNoLock(pipIdx)) {
180 return pips[pipIdx].pipContents.pageIdxs[offsetInPIP];
181 } else if (pipIdx == pips.size() - 1 && pipUpdates.updatedLastPIP) {
182 return pipUpdates.updatedLastPIP->pipContents.pageIdxs[offsetInPIP];
183 } else {
184 DASSERT(pipIdx >= pips.size() && pipIdx - pips.size() < pipUpdates.newPIPs.size());
185 return pipUpdates.newPIPs[pipIdx - pips.size()].pipContents.pageIdxs[offsetInPIP];
186 }
187}
188
189page_idx_t DiskArrayInternal::getUpdatedPageIdxOfPipNoLock(uint64_t pipIdx) {
190 if (pipIdx < pips.size()) {

Callers 1

disk_array.cppFile · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected