| 175 | } |
| 176 | |
| 177 | page_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 | |
| 189 | page_idx_t DiskArrayInternal::getUpdatedPageIdxOfPipNoLock(uint64_t pipIdx) { |
| 190 | if (pipIdx < pips.size()) { |