JobInfo setProjectId(String projectId) { Builder builder = toBuilder(); if (jobId != null) { builder.setJobId(jobId.setProjectId(projectId)); } return builder.setConfiguration(configuration.setProjectId(projectId)).build(); }
@Test public void testSetProjectId() { assertEquals(JOB_COMPLETE, JOB.setProjectId("project")); }
@Override public TableDataWriteChannel writer( JobId jobId, WriteChannelConfiguration writeChannelConfiguration) { return new TableDataWriteChannel( getOptions(), jobId.setProjectId(getOptions().getProjectId()), writeChannelConfiguration.setProjectId(getOptions().getProjectId())); }
final JobId completeJobId = jobId .setProjectId(serviceOptions.getProjectId()) .setLocation( jobId.getLocation() == null && serviceOptions.getLocation() != null
@Override public boolean cancel(JobId jobId) { final JobId completeJobId = jobId .setProjectId(getOptions().getProjectId()) .setLocation( jobId.getLocation() == null && getOptions().getLocation() != null ? getOptions().getLocation() : jobId.getLocation()); try { return runWithRetries( new Callable<Boolean>() { @Override public Boolean call() { return bigQueryRpc.cancel( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation()); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } }
final JobId completeJobId = jobId .setProjectId(getOptions().getProjectId()) .setLocation( jobId.getLocation() == null && getOptions().getLocation() != null
JobInfo setProjectId(String projectId) { Builder builder = toBuilder(); if (jobId != null) { builder.setJobId(jobId.setProjectId(projectId)); } return builder.setConfiguration(configuration.setProjectId(projectId)).build(); }
@Override public TableDataWriteChannel writer( JobId jobId, WriteChannelConfiguration writeChannelConfiguration) { return new TableDataWriteChannel( getOptions(), jobId.setProjectId(getOptions().getProjectId()), writeChannelConfiguration.setProjectId(getOptions().getProjectId())); }
@Override public boolean cancel(JobId jobId) { final JobId completeJobId = jobId.setProjectId(getOptions().getProjectId()); try { return runWithRetries( new Callable<Boolean>() { @Override public Boolean call() { return bigQueryRpc.cancel( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation()); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } }
final BigQueryOptions serviceOptions, final Map<BigQueryRpc.Option, ?> optionsMap) { final JobId completeJobId = jobId.setProjectId(serviceOptions.getProjectId()); try { GetQueryResultsResponse results =
@Override public Job getJob(JobId jobId, JobOption... options) { final Map<BigQueryRpc.Option, ?> optionsMap = optionMap(options); final JobId completeJobId = jobId.setProjectId(getOptions().getProjectId()); try { com.google.api.services.bigquery.model.Job answer = runWithRetries( new Callable<com.google.api.services.bigquery.model.Job>() { @Override public com.google.api.services.bigquery.model.Job call() { return bigQueryRpc.getJob( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation(), optionsMap); } }, getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); return answer == null ? null : Job.fromPb(this, answer); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } }