@Override public Tuple next() throws SQLException { while (true) { if (!initSnapshotScanner()) return null; try { lastTuple = scanIterator.next(); if (lastTuple != null) { ImmutableBytesWritable ptr = new ImmutableBytesWritable(); lastTuple.getKey(ptr); return lastTuple; } } finally { if (lastTuple == null) { scanIterator.close(); scanIterator = UNINITIALIZED_SCANNER; } } } }
@Override public void explain(List<String> planSteps) { iterator.explain(planSteps); }
@Override public void close() throws SQLException { delegate.close(); }
@Override protected Tuple advance() throws SQLException { return iterator.next(); } };
@Override public Tuple next() throws SQLException { return delegate.next(); }
@Override public void close() throws SQLException { delegate.close(); }
@Override public void explain(List<String> planSteps) { delegate.explain(planSteps); }
rhsCurrent = rhsIter.next(); if (rhsCurrent == null) { rhsIter.close(); rhsIter = null; } else if (isSingleValueOnly) { current = iter.next(); if (current == null) { close(); rhsCurrent = rhsIter.next(); if ((rhsCurrent == null && (joinType == JoinType.Inner || joinType == JoinType.Semi)) || (rhsCurrent != null && joinType == JoinType.Anti)) { rhsIter.close(); rhsIter = null; rhsIter.close(); rhsIter = null;
@Override public void close() throws SQLException { delegate.close(); }
@Override public void explain(List<String> planSteps) { delegate.explain(planSteps); }
@Override public void close() throws SQLException { iterator.close(); }
@Override public void explain(List<String> planSteps) { resultIterator.explain(planSteps); }
@Override public Tuple next() throws SQLException { if (chunkComplete || lastKey == null) { return null; } Tuple next = delegate.next(); if (next != null) { // We actually keep going past the chunk size until the row key changes. This is // necessary for (at least) hash joins, as they can return multiple rows with the // same row key. Stopping a chunk at a row key boundary is necessary in order to // be able to start the next chunk on the next row key if (rowCount == chunkSize) { next.getKey(lastKey); } else if (rowCount > chunkSize && rowKeyChanged(next)) { chunkComplete = true; return null; } rowCount++; } else { lastKey = null; } return next; }
@Override public void close() throws IOException { if(resultIterator != null) { try { resultIterator.close(); } catch (SQLException e) { LOG.error(" Error closing resultset."); throw new RuntimeException(e); } } }