MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / updateParentPointers

Method updateParentPointers

src/java/simpledb/index/BTreeFile.java:474–486  ·  view source on GitHub ↗

Update the parent pointer of every child of the given page so that it correctly points to the parent @param tid - the transaction id @param dirtypages - the list of dirty pages which should be updated with all new dirty pages @param page - the parent page @see #updateParentPointer(TransactionId, Ma

(TransactionId tid, Map<PageId, Page> dirtypages, BTreeInternalPage page)

Source from the content-addressed store, hash-verified

472 * @throws TransactionAbortedException
473 */
474 private void updateParentPointers(TransactionId tid, Map<PageId, Page> dirtypages, BTreeInternalPage page)
475 throws DbException, TransactionAbortedException{
476 Iterator<BTreeEntry> it = page.iterator();
477 BTreePageId pid = page.getId();
478 BTreeEntry e = null;
479 while(it.hasNext()) {
480 e = it.next();
481 updateParentPointer(tid, dirtypages, pid, e.getLeftChild());
482 }
483 if(e != null) {
484 updateParentPointer(tid, dirtypages, pid, e.getRightChild());
485 }
486 }
487
488 /**
489 * Method to encapsulate the process of locking/fetching a page. First the method checks the local

Callers 4

splitInternalPageMethod · 0.95
mergeInternalPagesMethod · 0.95

Calls 7

updateParentPointerMethod · 0.95
getLeftChildMethod · 0.95
getRightChildMethod · 0.95
iteratorMethod · 0.65
getIdMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected