private QueryResponse waitForQueryResults( RetrySettings waitSettings, final QueryResultsOption... resultsOptions) throws InterruptedException { if (getConfiguration().getType() != Type.QUERY) { throw new UnsupportedOperationException( "Waiting for query results is supported only for " + Type.QUERY + " jobs"); } try { return RetryHelper.poll( new Callable<QueryResponse>() { @Override public QueryResponse call() { return bigquery.getQueryResults(getJobId(), resultsOptions); } }, waitSettings, new BasicResultRetryAlgorithm<QueryResponse>() { @Override public boolean shouldRetry(Throwable prevThrowable, QueryResponse prevResponse) { return prevResponse != null && !prevResponse.getCompleted(); } }, options.getClock()); } catch (ExecutionException e) { throw BigQueryException.translateAndThrow(e); } }
throws InterruptedException, JobException { checkNotDryRun("getQueryResults"); if (getConfiguration().getType() != Type.QUERY) { throw new UnsupportedOperationException( "Getting query results is supported only for " + Type.QUERY + " jobs");
checkNotDryRun("waitFor"); Object completedJobResponse; if (getConfiguration().getType() == Type.QUERY) { completedJobResponse = waitForQueryResults(
private QueryResponse waitForQueryResults( RetrySettings waitSettings, final QueryResultsOption... resultsOptions) throws InterruptedException { if (getConfiguration().getType() != Type.QUERY) { throw new UnsupportedOperationException( "Waiting for query results is supported only for " + Type.QUERY + " jobs"); } try { return RetryHelper.poll( new Callable<QueryResponse>() { @Override public QueryResponse call() { return bigquery.getQueryResults(getJobId(), resultsOptions); } }, waitSettings, new BasicResultRetryAlgorithm<QueryResponse>() { @Override public boolean shouldRetry(Throwable prevThrowable, QueryResponse prevResponse) { return prevResponse != null && !prevResponse.getCompleted(); } }, options.getClock()); } catch (ExecutionException e) { throw BigQueryException.translateAndThrow(e); } }
throws InterruptedException, JobException { checkNotDryRun("getQueryResults"); if (getConfiguration().getType() != Type.QUERY) { throw new UnsupportedOperationException( "Getting query results is supported only for " + Type.QUERY + " jobs");
checkNotDryRun("waitFor"); Object completedJobResponse; if (getConfiguration().getType() == Type.QUERY) { completedJobResponse = waitForQueryResults(