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

Method open

src/java/simpledb/execution/Join.java:82–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 }
81
82 public void open() throws DbException, NoSuchElementException,
83 TransactionAbortedException {
84 // some code goes here
85 child1.open();
86 child2.open();
87
88 while(child1.hasNext()){
89 Tuple next1 = child1.next();
90 while(child2.hasNext()){
91 Tuple next2 = child2.next();
92 if(joinPredicate.filter(next1,next2)){
93 Tuple mergeTuple = new Tuple(tupleDesc);
94 Iterator<Field> fields1 = next1.fields();
95 Iterator<Field> fields2 = next2.fields();
96 int count = 0;
97 while(fields1.hasNext()){
98 mergeTuple.setField(count++,fields1.next());
99 }
100 while(fields2.hasNext()){
101 mergeTuple.setField(count++,fields2.next());
102 }
103 childTuple.add(mergeTuple);
104 }
105 }
106 child2.rewind();
107 }
108 it = childTuple.iterator();
109 super.open();
110 }
111
112 public void close() {
113 // some code goes here

Callers 3

rewindMethod · 0.95
gtJoinMethod · 0.95
eqJoinMethod · 0.95

Calls 8

fieldsMethod · 0.95
setFieldMethod · 0.95
openMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
rewindMethod · 0.65
iteratorMethod · 0.65
filterMethod · 0.45

Tested by 3

rewindMethod · 0.76
gtJoinMethod · 0.76
eqJoinMethod · 0.76