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

Method run

src/java/simpledb/index/BTreeUtility.java:512–540  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

510 }
511
512 public void run() {
513 try {
514 int c = 0;
515 while(c < count) {
516 Tuple t = BTreeUtility.getBTreeTuple(item, 2);
517 Database.getBufferPool().insertTuple(tid, bf.getId(), t);
518
519 IndexPredicate ipred = new IndexPredicate(Op.EQUALS, t.getField(bf.keyField()));
520 DbFileIterator it = bf.indexIterator(tid, ipred);
521 it.open();
522 c = 0;
523 while(it.hasNext()) {
524 it.next();
525 c++;
526 }
527 it.close();
528 }
529 synchronized(slock) {
530 success = true;
531 }
532 } catch (Exception e) {
533 e.printStackTrace();
534 synchronized(elock) {
535 error = e;
536 }
537
538 Database.getBufferPool().transactionComplete(tid, false);
539 }
540 }
541
542 /**
543 * @return true if we successfully inserted the tuple

Callers

nothing calls this directly

Calls 12

getBTreeTupleMethod · 0.95
getBufferPoolMethod · 0.95
getFieldMethod · 0.95
openMethod · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
closeMethod · 0.95
keyFieldMethod · 0.80
insertTupleMethod · 0.65
getIdMethod · 0.65
indexIteratorMethod · 0.45
transactionCompleteMethod · 0.45

Tested by

no test coverage detected