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

Method fetchNext

src/java/simpledb/execution/Project.java:72–82  ·  view source on GitHub ↗

Operator.fetchNext implementation. Iterates over tuples from the child operator, projecting out the fields from the tuple @return The next tuple, or null if there are no more tuples

()

Source from the content-addressed store, hash-verified

70 * @return The next tuple, or null if there are no more tuples
71 */
72 protected Tuple fetchNext() throws NoSuchElementException,
73 TransactionAbortedException, DbException {
74 if (!child.hasNext()) return null;
75 Tuple t = child.next();
76 Tuple newTuple = new Tuple(td);
77 newTuple.setRecordId(t.getRecordId());
78 for (int i = 0; i < td.numFields(); i++) {
79 newTuple.setField(i, t.getField(outFieldIds.get(i)));
80 }
81 return newTuple;
82 }
83
84 @Override
85 public OpIterator[] getChildren() {

Callers

nothing calls this directly

Calls 8

setRecordIdMethod · 0.95
getRecordIdMethod · 0.95
setFieldMethod · 0.95
getFieldMethod · 0.95
getMethod · 0.80
hasNextMethod · 0.65
nextMethod · 0.65
numFieldsMethod · 0.45

Tested by

no test coverage detected