@Override public boolean canBePurged() { //If the result is completely pre-fetched, defer the purging until preFetchedRows have been consumed. //In Case not consumed, it should be cleared based on lens.server.inmemory.resultset.ttl.secs if (isComplteleyFetched && !preFetchedRowsConsumed) { return false; } else { return inMemoryRS.canBePurged(); } }
@Override public String toString() { return getFullyQualifiedName(); } }
@Override public Integer size() throws LensException { if (isComplteleyFetched) { return numOfPreFetchedRows; } else { return inMemoryRS.size(); } }
public boolean isSuccessful() { return state.equals(DriverQueryState.SUCCESSFUL); } public boolean isCanceled() {
@Override public boolean hasNext() throws LensException { cursor++; if (cursor <= numOfPreFetchedRows) { return true; } else if (isComplteleyFetched) { return false; } else { return inMemoryRS.hasNext(); } }
@Override public DriverQueryPlan explainAndPrepare(PreparedQueryContext pContext) throws LensException { DriverQueryPlan p = new MockQueryPlan(pContext.getSelectedDriverQuery()); p.setPrepareHandle(pContext.getPrepareHandle()); return p; }
@Override public void setFullyAccessed(boolean fullyAccessed) { inMemoryRS.setFullyAccessed(fullyAccessed); }
@Override public void setFetchSize(int size) throws LensException { inMemoryRS.setFetchSize(size); }
public ImmutableSet<WaitingQueriesSelectionPolicy> getDriverSelectionPolicies() { return this.selectedDriver.getWaitingQuerySelectionPolicies(); } }
public boolean isRunning() { return state.equals(DriverQueryState.RUNNING); } }
@Override public boolean hasNext() throws LensException { cursor++; if (cursor <= numOfPreFetchedRows) { return true; } else if (isComplteleyFetched) { return false; } else { return inMemoryRS.hasNext(); } }
@Override public boolean canBePurged() { //If the result is completely pre-fetched, defer the purging until preFetchedRows have been consumed. //In Case not consumed, it should be cleared based on lens.server.inmemory.resultset.ttl.secs if (isComplteleyFetched && !preFetchedRowsConsumed) { return false; } else { return inMemoryRS.canBePurged(); } }
/** * Gets the path (relative to lens server's conf location) for the driver resource in the system. This is a utility * method that can be used by extending driver implementations to build path for their resources. * * @param resourceName * @return */ protected String getDriverResourcePath(String resourceName) { return LensConfConstants.DRIVERS_BASE_DIR + SEPARATOR + getFullyQualifiedName() + SEPARATOR + resourceName; }
@Override public Integer size() throws LensException { if (isComplteleyFetched) { return numOfPreFetchedRows; } else { return inMemoryRS.size(); } }
@Override public void setFetchSize(int size) throws LensException { inMemoryRS.setFetchSize(size); }
@Override public String toString() { return getFullyQualifiedName(); } }
public boolean isSuccessful() { return state.equals(DriverQueryState.SUCCESSFUL); } public boolean isCanceled() {
/** * Gets the path (relative to lens server's conf location) for the driver resource in the system. This is a utility * method that can be used by extending driver implementations to build path for their resources. * * @param resourceName * @return */ protected String getDriverResourcePath(String resourceName) { return LensConfConstants.DRIVERS_BASE_DIR + SEPARATOR + getFullyQualifiedName() + SEPARATOR + resourceName; }
public boolean isCanceled() { return state.equals(DriverQueryState.CANCELED); } public boolean isFailed() {