-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathInsert.java
More file actions
74 lines (64 loc) · 2.1 KB
/
Copy pathInsert.java
File metadata and controls
74 lines (64 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package simpledb;
/**
* Inserts tuples read from the child operator into the tableId specified in the
* constructor
*/
public class Insert extends Operator {
private static final long serialVersionUID = 1L;
/**
* Constructor.
*
* @param t
* The transaction running the insert.
* @param child
* The child operator from which to read tuples to be inserted.
* @param tableId
* The table in which to insert tuples.
* @throws DbException
* if TupleDesc of child differs from table into which we are to
* insert.
*/
public Insert(TransactionId t, OpIterator child, int tableId)
throws DbException {
// some code goes here
}
public TupleDesc getTupleDesc() {
// some code goes here
return null;
}
public void open() throws DbException, TransactionAbortedException {
// some code goes here
}
public void close() {
// some code goes here
}
public void rewind() throws DbException, TransactionAbortedException {
// some code goes here
}
/**
* Inserts tuples read from child into the tableId specified by the
* constructor. It returns a one field tuple containing the number of
* inserted records. Inserts should be passed through BufferPool. An
* instances of BufferPool is available via Database.getBufferPool(). Note
* that insert DOES NOT need check to see if a particular tuple is a
* duplicate before inserting it.
*
* @return A 1-field tuple containing the number of inserted records, or
* null if called more than once.
* @see Database#getBufferPool
* @see BufferPool#insertTuple
*/
protected Tuple fetchNext() throws TransactionAbortedException, DbException {
// some code goes here
return null;
}
@Override
public OpIterator[] getChildren() {
// some code goes here
return null;
}
@Override
public void setChildren(OpIterator[] children) {
// some code goes here
}
}