use of org.apache.phoenix.schema.tuple.Tuple in project phoenix by apache.
the class ConcatResultIterator method currentIterator.
private PeekingResultIterator currentIterator() throws SQLException {
List<PeekingResultIterator> iterators = getIterators();
while (index < iterators.size()) {
PeekingResultIterator iterator = iterators.get(index);
Tuple r = iterator.peek();
if (r != null) {
return iterator;
}
iterator.close();
index++;
}
return EMPTY_ITERATOR;
}
use of org.apache.phoenix.schema.tuple.Tuple in project phoenix by apache.
the class DistinctAggregatingResultIterator method getResultIterator.
private Iterator<ResultEntry> getResultIterator() throws SQLException {
if (resultIterator != null) {
return resultIterator;
}
// TODO: size?
Set<ResultEntry> entries = Sets.<ResultEntry>newHashSet();
try {
for (Tuple result = delegate.next(); result != null; result = delegate.next()) {
ResultEntry entry = new ResultEntry(result);
entries.add(entry);
}
} finally {
delegate.close();
}
resultIterator = entries.iterator();
return resultIterator;
}
use of org.apache.phoenix.schema.tuple.Tuple in project phoenix by apache.
the class LookAheadResultIterator method next.
@Override
public Tuple next() throws SQLException {
init();
Tuple next = this.next;
this.next = advance();
return next;
}
use of org.apache.phoenix.schema.tuple.Tuple in project phoenix by apache.
the class MaterializedComparableResultIterator method next.
@Override
public Tuple next() throws SQLException {
Tuple next = delegate.next();
this.current = delegate.peek();
return next;
}
use of org.apache.phoenix.schema.tuple.Tuple in project phoenix by apache.
the class MergeSortResultIterator method next.
@Override
public Tuple next() throws SQLException {
MaterializedComparableResultIterator iterator = minIterator();
if (iterator == null) {
return null;
}
Tuple next = iterator.next();
minHeap.poll();
if (iterator.peek() != null) {
minHeap.add(iterator);
} else {
iterator.close();
}
return next;
}
Aggregations