| 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 |