long executeTimeOutTime = submissionTime + executeTimeoutMillis; if (System.currentTimeMillis() < executeTimeOutTime) { this.driverResult = new PartiallyFetchedInMemoryResultSet((InMemoryResultSet) result, rowsToPreFetch); return; } else {
/** * Constructor * @param inMemoryRS : Underlying in-memory result set * @param reqPreFetchSize : requested number of rows to be pre-fetched and cached. * @throws LensException */ public PartiallyFetchedInMemoryResultSet(InMemoryResultSet inMemoryRS, int reqPreFetchSize) throws LensException { this.inMemoryRS = inMemoryRS; if (reqPreFetchSize <= 0) { throw new IllegalArgumentException("Invalid pre fetch size " + reqPreFetchSize); } cachedResultSetMetadata = inMemoryRS.getMetadata(); preFetchRows(reqPreFetchSize); log.info("Pre-Fetched {} rows of result and isComplteleyFetched = {} and doNotPurgeUntilTimeMillis ={}", numOfPreFetchedRows, isComplteleyFetched); }
assertEquals(prs.isComplteleyFetched(), isComplteleyFetched); assertTrue(prs.isComplteleyFetched()); prs.getPreFetchedRows(); //This will be called while streaming assertEquals(prs.size().intValue(), rowsPreFetched); } else { assertFalse(prs.isComplteleyFetched()); assertEquals(prs.getPreFetchedRows().size(), rowsPreFetched); assertEquals(prs.getMetadata().getColumns().size(), 1); assertEquals(prs.getMetadata().getColumns().get(0).getName(), "ID"); while (prs.hasNext()) { ResultRow row = prs.next(); assertEquals(row.getValues().get(0), rowCount); rowCount++; prs.setFullyAccessed(true); assertEquals(prs.canBePurged(), true);
if (resultSet instanceof PartiallyFetchedInMemoryResultSet) { PartiallyFetchedInMemoryResultSet partialnMemoryResult = (PartiallyFetchedInMemoryResultSet) resultSet; if (partialnMemoryResult.isComplteleyFetched()) { // DO not stream the result if its not completely fetched result.setResult(new InMemoryQueryResult(partialnMemoryResult.getPreFetchedRows())); result.setResultMetadata(partialnMemoryResult.getMetadata().toQueryResultSetMetadata()); result.setStatus(queryCtx.getStatus()); return result;
/** * Constructor * @param inMemoryRS : Underlying in-memory result set * @param reqPreFetchSize : requested number of rows to be pre-fetched and cached. * @throws LensException */ public PartiallyFetchedInMemoryResultSet(InMemoryResultSet inMemoryRS, int reqPreFetchSize) throws LensException { this.inMemoryRS = inMemoryRS; if (reqPreFetchSize <= 0) { throw new IllegalArgumentException("Invalid pre fetch size " + reqPreFetchSize); } cachedResultSetMetadata = inMemoryRS.getMetadata(); preFetchRows(reqPreFetchSize); log.info("Pre-Fetched {} rows of result and isComplteleyFetched = {} and doNotPurgeUntilTimeMillis ={}", numOfPreFetchedRows, isComplteleyFetched); }
long executeTimeOutTime = submissionTime + executeTimeoutMillis; if (System.currentTimeMillis() < executeTimeOutTime) { this.driverResult = new PartiallyFetchedInMemoryResultSet((InMemoryResultSet) result, rowsToPreFetch); return; } else {