@Override public void close() throws SQLException { if (currentIterator != null) { currentIterator.close(); } }
@Override public void close() throws SQLException { // Guard against resultIterator being null if (null != resultIterator) { resultIterator.close(); } resultIterator = PeekingResultIterator.EMPTY_ITERATOR; }
@Override public void close() throws SQLException { resultIterator.close(); }
@Override public void close() throws SQLException { delegate.close(); }
@Override public void close() throws SQLException { delegate.close(); }
@Override public void close() throws SQLException { spoolFrom.close(); }
@Override public void close() throws SQLException { resultIterator.close(); }
public void closeCursor() throws SQLException { delegate.close(); }
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; }
private PriorityQueue<MaterializedComparableResultIterator> getMinHeap() throws SQLException { if (minHeap == null) { List<PeekingResultIterator> iterators = resultIterators.getIterators(); minHeap = new PriorityQueue<MaterializedComparableResultIterator>(Math.max(1, iterators.size())); for (PeekingResultIterator itr : iterators) { if (itr.peek() == null) { itr.close(); continue; } minHeap.add(new MaterializedComparableResultIterator(itr, itrComparator)); } } return minHeap; }
private Tuple nextTuple() throws SQLException { List<PeekingResultIterator> iterators = getIterators(); while (index < iterators.size()) { PeekingResultIterator iterator = iterators.get(index); Tuple r = iterator.peek(); if (r != null) { return iterator.next(); } traversedIterator = true; iterator.close(); index++; } return null; }
private PeekingResultIterator currentIterator() throws SQLException { if (currentIterator == null) { return currentIterator = nextIterator(); } if (currentIterator.peek() == null) { currentIterator.close(); currentIterator = nextIterator(); } return currentIterator; }
try { PeekingResultIterator iterator = future.get(); iterator.close(); } catch (InterruptedException e) { Thread.currentThread().interrupt();
PeekingResultIterator iterator = iterators.get(index); try { iterator.close(); } catch (Exception e) { if (toThrow == null) {
@Override public Tuple next() throws SQLException { ResultEntry entry = queueEntries.poll(); while (entry != null && offset != null && count < offset) { count++; if (entry.getResult() == null) { return null; } entry = queueEntries.poll(); } if (entry == null || (limit != null && count++ > limit)) { resultIterator.close(); resultIterator = PeekingResultIterator.EMPTY_ITERATOR; return null; } return entry.getResult(); }
PeekingResultIterator iterator = iterators.get(index); try { iterator.close(); } catch (Exception e) { if (toThrow == null) {
PeekingResultIterator iterator = iterators.get(index); try { iterator.close(); } catch (Exception e) { if (toThrow == null) {
@Override public void close() throws SQLException { // Guard against resultIterator being null if (null != resultIterator) { resultIterator.close(); } resultIterator = PeekingResultIterator.EMPTY_ITERATOR; }
private PeekingResultIterator getResultIterator() throws SQLException { if (resultIterator.peek() == null && lastKey != null) { resultIterator.close(); scan = ScanUtil.newScan(scan); if(ScanUtil.isLocalIndex(scan)) { scan.setAttribute(SCAN_START_ROW_SUFFIX, ByteUtil.copyKeyBytesIfNecessary(lastKey)); } else { scan.setStartRow(ByteUtil.copyKeyBytesIfNecessary(lastKey)); } if (logger.isDebugEnabled()) logger.debug(LogUtil.addCustomAnnotations("Get next chunked result iterator over " + tableRef.getTable().getPhysicalName().getString() + " with " + scan, ScanUtil.getCustomAnnotations(scan))); String tableName = tableRef.getTable().getPhysicalName().getString(); ReadMetricQueue readMetrics = context.getReadMetricsQueue(); ScanMetricsHolder scanMetricsHolder = ScanMetricsHolder.getInstance(readMetrics, tableName, scan, context.getConnection().getLogLevel()); long renewLeaseThreshold = context.getConnection().getQueryServices().getRenewLeaseThresholdMilliSeconds(); ResultIterator singleChunkResultIterator = new SingleChunkResultIterator(new TableResultIterator(mutationState, scan, scanMetricsHolder, renewLeaseThreshold, plan, DefaultParallelScanGrouper.getInstance()), chunkSize); resultIterator = delegateIteratorFactory.newIterator(context, singleChunkResultIterator, scan, tableName, plan); } return resultIterator; }