public void close() throws IOException { iterator.close(); } };
public Iterable<Row> resolve() { ArrayList<RowIterator> iters = new ArrayList<>(responses.size()); int n = 0; for (MessageIn<RangeSliceReply> response : responses) { RangeSliceReply reply = response.payload; n = Math.max(n, reply.rows.size()); iters.add(new RowIterator(reply.rows.iterator(), response.from)); } // for each row, compute the combination of all different versions seen, and repair incomplete versions // TODO do we need to call close? CloseableIterator<Row> iter = MergeIterator.get(iters, pairComparator, new Reducer()); List<Row> resolvedRows = new ArrayList<>(n); while (iter.hasNext()) resolvedRows.add(iter.next()); return resolvedRows; }
public final void close() { Throwable fail = runOnClose(length); if (next instanceof AutoCloseable) { try { ((AutoCloseable) next).close(); } catch (Throwable t) { fail = merge(fail, t); } } try { input.close(); } catch (Throwable t) { fail = merge(fail, t); } maybeFail(fail); }
protected Row computeNext() { // pull a row out of the iterator if (!iterator.hasNext()) return endOfData(); Row current = iterator.next(); DecoratedKey key = current.key; if (!range.stopKey().isMinimum(partitioner) && range.stopKey().compareTo(key) < 0) return endOfData(); // skipping outside of assigned range if (!range.contains(key)) return computeNext(); if (logger.isTraceEnabled()) logger.trace("scanned {}", metadata.getKeyValidator().getString(key.getKey())); return current; }
public final void close() { Throwable fail = runOnClose(length); if (next instanceof AutoCloseable) { try { ((AutoCloseable) next).close(); } catch (Throwable t) { fail = merge(fail, t); } } try { input.close(); } catch (Throwable t) { fail = merge(fail, t); } maybeFail(fail); }
public final void close() { Throwable fail = runOnClose(length); if (next instanceof AutoCloseable) { try { ((AutoCloseable) next).close(); } catch (Throwable t) { fail = merge(fail, t); } } try { input.close(); } catch (Throwable t) { fail = merge(fail, t); } maybeFail(fail); }
public final void close() { Throwable fail = runOnClose(length); if (next instanceof AutoCloseable) { try { ((AutoCloseable) next).close(); } catch (Throwable t) { fail = merge(fail, t); } } try { input.close(); } catch (Throwable t) { fail = merge(fail, t); } maybeFail(fail); }