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

Method open

src/java/simpledb/execution/Insert.java:57–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 }
56
57 public void open() throws DbException, TransactionAbortedException {
58 // some code goes here
59 child.open();
60 int count = 0;
61 while(child.hasNext()){
62 Tuple next = child.next();
63 count++;
64 try {
65 Database.getBufferPool().insertTuple(this.t,this.tableId,next);
66 } catch (IOException e) {
67 e.printStackTrace();
68 }
69 }
70 Tuple tuple = new Tuple(getTupleDesc());
71 tuple.setField(0, new IntField(count));
72 tupleList.add(tuple);
73 iterator = tupleList.iterator();
74 super.open();
75 }
76
77 public void close() {
78 // some code goes here

Callers 5

getNextMethod · 0.95
insertRowMethod · 0.95
insertRowMethod · 0.95
validateInsertMethod · 0.95
insertRowMethod · 0.95

Calls 8

getBufferPoolMethod · 0.95
getTupleDescMethod · 0.95
setFieldMethod · 0.95
openMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
insertTupleMethod · 0.65
iteratorMethod · 0.65

Tested by 5

getNextMethod · 0.76
insertRowMethod · 0.76
insertRowMethod · 0.76
validateInsertMethod · 0.76
insertRowMethod · 0.76