@Override public ResultRow next() throws LensException { if (cursor <= numOfPreFetchedRows) { return preFetchedRows.get(cursor-1); } else { return inMemoryRS.next(); } }
@Override public ResultRow next() throws LensException { if (cursor <= numOfPreFetchedRows) { return preFetchedRows.get(cursor-1); } else { return inMemoryRS.next(); } }
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 {
ResultRow row = rs.next(); List<Object> rowObjects = row.getValues(); System.out.println(rowObjects);
InMemoryResultSet inmemory = (InMemoryResultSet) resultSet; while (inmemory.hasNext()) { ((InMemoryOutputFormatter) formatter).writeRow(inmemory.next());
ResultRow row = rs.next(); List<Object> rowObjects = row.getValues();
List<String> explainOutput = new ArrayList<>(); while (inMemoryResultSet.hasNext()) { explainOutput.add((String) inMemoryResultSet.next().getValues().get(0));
ResultRow row = rs.next(); List<Object> rowObjects = row.getValues(); System.out.println(rowObjects);
ResultRow row = rs.next(); List<Object> rowObjects = row.getValues();
List<String> explainOutput = new ArrayList<>(); while (inMemoryResultSet.hasNext()) { explainOutput.add((String) inMemoryResultSet.next().getValues().get(0));
ResultRow row = rs.next(); List<Object> rowObjects = row.getValues();
List<Object> vals = rs.next().getValues(); assertEquals(vals.size(), 1); assertEquals(vals.get(0).getClass(), Integer.class);