private void addAllRowsToResult(RowResultIterator it, int recordcount, List<String> querySchema, Vector<HashMap<String, ByteIterator>> result) throws Exception { RowResult row; HashMap<String, ByteIterator> rowResult = new HashMap<>(querySchema.size()); if (it == null) { return; } while (it.hasNext()) { if (result.size() == recordcount) { return; } row = it.next(); int colIdx = 0; for (String col : querySchema) { rowResult.put(col, new StringByteIterator(row.getString(colIdx))); colIdx++; } result.add(rowResult); } }
@Override public int next() { int rowCount = 0; try { while (iterator == null || !iterator.hasNext()) { if (!scanner.hasMoreRows()) { iterator = null; return 0; } context.getStats().startWait(); try { iterator = scanner.nextRows(); } finally { context.getStats().stopWait(); } } for (; rowCount < TARGET_RECORD_COUNT && iterator.hasNext(); rowCount++) { addRowResult(iterator.next(), rowCount); } } catch (Exception ex) { throw new RuntimeException(ex); } for (ProjectedColumnInfo pci : projectedCols) { pci.vv.getMutator().setValueCount(rowCount); } return rowCount; }
while (scanner.hasMoreRows()) { RowResultIterator results = scanner.nextRows(); while (results.hasNext()) { logger.debug(results.next().toString());
while (rowResultIter.hasNext())
while (results.hasNext())
/** * get next Row/Page */ @Override public boolean advanceNextPosition() { boolean needNextRows = !started || !nextRows.hasNext(); if (!started) { started = true; nanoStart = System.nanoTime(); } if (needNextRows) { currentRow = null; try { do { if (!scanner.hasMoreRows()) { return false; } nextRows = scanner.nextRows(); } while (!nextRows.hasNext()); log.debug("Fetched " + nextRows.getNumRows() + " rows"); } catch (KuduException e) { currentRow = null; throw new RuntimeException(e); } } currentRow = nextRows.next(); totalBytes += getRowLength(); return true; }
@Override public KuduRow nextRecord(KuduRow reuse) throws IOException { // check that current iterator has next rows if (this.resultIterator.hasNext()) { RowResult row = this.resultIterator.next(); return KuduMapper.toKuduRow(row); } // if not, check that current scanner has more iterators else if (scanner.hasMoreRows()) { this.resultIterator = scanner.nextRows(); return nextRecord(reuse); } else { endReached = true; } return null; }
break; } else { while (resultIterator.hasNext()) { KuduRecordWithMeta<T> recordWithMeta = new KuduRecordWithMeta<>(); RowResult aRow = resultIterator.next();
while (scanner.hasMoreRows()) { RowResultIterator it = scanner.nextRows(); assertTrue(it.hasNext()); RowResult rr = it.next(); assertEquals(rr.getInt(0), rr.getInt(1));
if (scanner.hasMoreRows()) { RowResultIterator rri = scanner.nextRows(); while (rri.hasNext()) { int key = rri.next().getInt(0); if (key < previousRow) { while (scanner.hasMoreRows()) { RowResultIterator rri = scanner.nextRows(); while (rri.hasNext()) { int key = rri.next().getInt(0); if (key < previousRow) {
while (scanner.hasMoreRows()) { RowResultIterator it = scanner.nextRows(); assertTrue(it.hasNext()); RowResult rr = it.next(); assertEquals((byte) 0x01, rr.getByte(0));
while (scanner.hasMoreRows()) { RowResultIterator it = scanner.nextRows(); assertTrue(it.hasNext()); RowResult rr = it.next();