@Override public boolean cancel(String jobId) { try { bigquery.jobs().cancel(this.options.projectId(), jobId).execute(); return true; } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.code() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }
/** * Requests that a job be cancelled. This call will return immediately, and the client will need to * poll for the job status to see if the cancel completed successfully. Cancelled jobs may still * incur costs. * * Create a request for the method "jobs.cancel". * * This request holds the parameters needed by the bigquery server. After setting any optional * parameters, call the {@link Cancel#execute()} method to invoke the remote operation. * * @param projectId [Required] Project ID of the job to cancel * @param jobId [Required] Job ID of the job to cancel * @return the request */ public Cancel cancel(java.lang.String projectId, java.lang.String jobId) throws java.io.IOException { Cancel result = new Cancel(projectId, jobId); initialize(result); return result; }
@Override public boolean cancel(String projectId, String jobId, String location) { try { bigquery.jobs().cancel(projectId, jobId).setLocation(location).execute(); return true; } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }
@Override public boolean cancel(String jobId) { try { bigquery.jobs().cancel(this.options.projectId(), jobId).execute(); return true; } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.code() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }
@Override public boolean cancel(String projectId, String jobId, String location) { try { bigquery.jobs().cancel(projectId, jobId).setLocation(location).execute(); return true; } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }