private Job waitForJob(RetrySettings waitSettings) throws InterruptedException { try { return RetryHelper.poll( new Callable<Job>() { @Override public Job call() throws Exception { return bigquery.getJob(getJobId(), JobOption.fields(BigQuery.JobField.STATUS)); } }, waitSettings, new BasicResultRetryAlgorithm<Job>() { @Override public TimedAttemptSettings createNextAttempt( Throwable prevThrowable, Job prevResponse, TimedAttemptSettings prevSettings) { return null; } @Override public boolean shouldRetry(Throwable prevThrowable, Job prevResponse) { return prevResponse != null && !JobStatus.State.DONE.equals(prevResponse.getStatus().getState()); } }, options.getClock()); } catch (ExecutionException e) { throw BigQueryException.translateAndThrow(e); } }
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); } }
try { Operation operation = RetryHelper.poll( new Callable<Operation>() { @Override
try { com.google.longrunning.Operation proto = RetryHelper.poll( new Callable<com.google.longrunning.Operation>() { @Override
private Job waitForJob(RetrySettings waitSettings) throws InterruptedException { try { return RetryHelper.poll( new Callable<Job>() { @Override public Job call() throws Exception { return bigquery.getJob(getJobId(), JobOption.fields(BigQuery.JobField.STATUS)); } }, waitSettings, new BasicResultRetryAlgorithm<Job>() { @Override public TimedAttemptSettings createNextAttempt( Throwable prevThrowable, Job prevResponse, TimedAttemptSettings prevSettings) { return null; } @Override public boolean shouldRetry(Throwable prevThrowable, Job prevResponse) { return prevResponse != null && !JobStatus.State.DONE.equals(prevResponse.getStatus().getState()); } }, options.getClock()); } catch (ExecutionException e) { throw BigQueryException.translateAndThrow(e); } }
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); } }
try { com.google.longrunning.Operation proto = RetryHelper.poll( new Callable<com.google.longrunning.Operation>() { @Override