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

Method open

src/java/simpledb/index/BTreeFile.java:1417–1429  ·  view source on GitHub ↗

Open this iterator by getting an iterator on the first leaf page applicable for the given predicate operation

()

Source from the content-addressed store, hash-verified

1415 * for the given predicate operation
1416 */
1417 public void open() throws DbException, TransactionAbortedException {
1418 BTreeRootPtrPage rootPtr = (BTreeRootPtrPage) Database.getBufferPool().getPage(
1419 tid, BTreeRootPtrPage.getId(f.getId()), Permissions.READ_ONLY);
1420 BTreePageId root = rootPtr.getRootId();
1421 if(ipred.getOp() == Op.EQUALS || ipred.getOp() == Op.GREATER_THAN
1422 || ipred.getOp() == Op.GREATER_THAN_OR_EQ) {
1423 curp = f.findLeafPage(tid, root, ipred.getField());
1424 }
1425 else {
1426 curp = f.findLeafPage(tid, root, null);
1427 }
1428 it = curp.iterator();
1429 }
1430
1431 /**
1432 * Read the next tuple either from the current page if it has more tuples matching

Callers 1

rewindMethod · 0.95

Calls 9

getBufferPoolMethod · 0.95
getIdMethod · 0.95
getRootIdMethod · 0.95
findLeafPageMethod · 0.80
getIdMethod · 0.65
iteratorMethod · 0.65
getPageMethod · 0.45
getOpMethod · 0.45
getFieldMethod · 0.45

Tested by

no test coverage detected