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); } }
currentRow = nextRows.next(); totalBytes += getRowLength(); return true;
@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; }
RowResultIterator results = scanner.nextRows(); while (results.hasNext()) { logger.debug(results.next().toString());
RowResult result = rowResultIter.next(); entity = KunderaCoreUtils.createNewInstance(m.getEntityClazz());
RowResult result = results.next(); entity = KunderaCoreUtils.createNewInstance(entityClass); populateEntity(entity, result, entityType, metaModel);
private static RowResult getOneRowResult(KuduScanner scanner) throws KuduException { RowResultIterator rowResults; rowResults = scanner.nextRows(); if (rowResults.getNumRows() == 0) { return null; } if (rowResults.getNumRows() > 1) { throw new RuntimeException("Received too many rows from scanner " + scanner); } return rowResults.next(); }
@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; }
/** * 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; }
currentRow = nextRows.next(); totalBytes += getRowLength(); return true;
while (resultIterator.hasNext()) { KuduRecordWithMeta<T> recordWithMeta = new KuduRecordWithMeta<>(); RowResult aRow = resultIterator.next(); recordWithMeta.setPositionInScan(numRowsScanned); T payload = clazzForResultObject.newInstance();
private void buildScannerAndCheckColumnsCount(AsyncKuduScanner.AsyncKuduScannerBuilder builder, int count) throws Exception { AsyncKuduScanner scanner = builder.build(); scanner.nextRows().join(DEFAULT_SLEEP); RowResultIterator rri = scanner.nextRows().join(DEFAULT_SLEEP); assertEquals(count, rri.next().getSchema().getColumns().size()); }
final RowResult next = rows.next();
RowResultIterator it = scanner.nextRows(); assertTrue(it.hasNext()); RowResult rr = it.next(); assertEquals(rr.getInt(0), rr.getInt(1));
RowResultIterator it = scanner.nextRows(); assertTrue(it.hasNext()); RowResult rr = it.next(); assertEquals((byte) 0x01, rr.getByte(0)); assertEquals((short) 2, rr.getShort(1));
RowResult rr = scanner.nextRows().next(); assertEquals(magicNumber, rr.getInt(1)); assertEquals(magicNumber, rr.getInt(2));
RowResultIterator it = scanner.nextRows(); assertTrue(it.hasNext()); RowResult rr = it.next();