@Override public boolean hasNext() throws LensException { cursor++; if (cursor <= numOfPreFetchedRows) { return true; } else if (isComplteleyFetched) { return false; } else { return inMemoryRS.hasNext(); } }
@Override public boolean hasNext() throws LensException { cursor++; if (cursor <= numOfPreFetchedRows) { return true; } else if (isComplteleyFetched) { return false; } else { return inMemoryRS.hasNext(); } }
private void preFetchRows(int reqPreFetchSize) throws LensException { //rows fetched = reqPreFetchSize+1. One extra row is read to check if underlying inMemoryRS result is completely //or partially read. preFetchedRows = new ArrayList<ResultRow>(reqPreFetchSize + 1); boolean hasNext = inMemoryRS.hasNext(); while (hasNext) { if (numOfPreFetchedRows >= reqPreFetchSize) { break; } preFetchedRows.add(inMemoryRS.next()); numOfPreFetchedRows++; hasNext = inMemoryRS.hasNext(); } if (!hasNext) { isComplteleyFetched = true; // No more rows to be read form inMemory result. } else { isComplteleyFetched = false; //we have accessed ( hasNext() for ) one extra row. Lets cache it too. preFetchedRows.add(inMemoryRS.next()); numOfPreFetchedRows++; } }
private void preFetchRows(int reqPreFetchSize) throws LensException { //rows fetched = reqPreFetchSize+1. One extra row is read to check if underlying inMemoryRS result is completely //or partially read. preFetchedRows = new ArrayList<ResultRow>(reqPreFetchSize + 1); boolean hasNext = inMemoryRS.hasNext(); while (hasNext) { if (numOfPreFetchedRows >= reqPreFetchSize) { break; } preFetchedRows.add(inMemoryRS.next()); numOfPreFetchedRows++; hasNext = inMemoryRS.hasNext(); } if (!hasNext) { isComplteleyFetched = true; // No more rows to be read form inMemory result. } else { isComplteleyFetched = false; //we have accessed ( hasNext() for ) one extra row. Lets cache it too. preFetchedRows.add(inMemoryRS.next()); numOfPreFetchedRows++; } }
public InMemoryQueryResult toQueryResult() throws LensException { List<ResultRow> rows = new ArrayList<>(); while (hasNext()) { rows.add(next()); } this.setFullyAccessed(true); return new InMemoryQueryResult(rows); } public boolean isHttpResultAvailable() throws LensException {
public InMemoryQueryResult toQueryResult() throws LensException { List<ResultRow> rows = new ArrayList<>(); while (hasNext()) { rows.add(next()); } this.setFullyAccessed(true); return new InMemoryQueryResult(rows); } public boolean isHttpResultAvailable() throws LensException {
assertEquals(col4.getName(), "c4".toUpperCase()); while (rs.hasNext()) { ResultRow row = rs.next(); List<Object> rowObjects = row.getValues();
log.info("Result formatter for {} in inmemory result", queryHandle); InMemoryResultSet inmemory = (InMemoryResultSet) resultSet; while (inmemory.hasNext()) { ((InMemoryOutputFormatter) formatter).writeRow(inmemory.next());
while (rs.hasNext()) { ResultRow row = rs.next(); List<Object> rowObjects = row.getValues();
assertEquals(col4.getName(), "c4".toUpperCase()); while (rs.hasNext()) { ResultRow row = rs.next(); List<Object> rowObjects = row.getValues();
while (inMemoryResultSet.hasNext()) { explainOutput.add((String) inMemoryResultSet.next().getValues().get(0));
assertEquals(col1.getName(), "ID"); while (rs.hasNext()) { ResultRow row = rs.next(); List<Object> rowObjects = row.getValues();
assertEquals(col1.getName(), "ID"); while (rs.hasNext()) { ResultRow row = rs.next(); List<Object> rowObjects = row.getValues();
while (inMemoryResultSet.hasNext()) { explainOutput.add((String) inMemoryResultSet.next().getValues().get(0));
System.out.println("Matched metadata"); while (rs.hasNext()) { List<Object> vals = rs.next().getValues(); assertEquals(vals.size(), 1);