本文整理汇总了Java中com.google.api.services.bigquery.model.Job.getJobReference方法的典型用法代码示例。如果您正苦于以下问题:Java Job.getJobReference方法的具体用法?Java Job.getJobReference怎么用?Java Job.getJobReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.api.services.bigquery.model.Job
的用法示例。
在下文中一共展示了Job.getJobReference方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitForJob
import com.google.api.services.bigquery.model.Job; //导入方法依赖的package包/类
/**
* Synchronously waits for a job to complete that's already been launched.
*
* @throws BigqueryJobFailureException
*/
private Job waitForJob(Job job) {
verify(job.getStatus() != null);
while (!job.getStatus().getState().equals("DONE")) {
sleeper.sleepUninterruptibly(pollInterval);
JobReference ref = job.getJobReference();
try {
job = bigquery.jobs().get(ref.getProjectId(), ref.getJobId()).execute();
} catch (IOException e) {
throw BigqueryJobFailureException.create(e);
}
}
return job;
}
示例2: beginExport
import com.google.api.services.bigquery.model.Job; //导入方法依赖的package包/类
@Override
public void beginExport() throws IOException {
// Create job and configuration.
JobConfigurationExtract extractConfig = new JobConfigurationExtract();
// Set source.
extractConfig.setSourceTable(tableToExport.getTableReference());
// Set destination.
extractConfig.setDestinationUris(getExportPaths());
extractConfig.set(DESTINATION_FORMAT_KEY, fileFormat.getFormatIdentifier());
JobConfiguration config = new JobConfiguration();
config.setExtract(extractConfig);
JobReference jobReference =
bigQueryHelper.createJobReference(projectId, "exporttocloudstorage");
Job job = new Job();
job.setConfiguration(config);
job.setJobReference(jobReference);
// Insert and run job.
try {
Job response = bigQueryHelper.insertJobOrFetchDuplicate(projectId, job);
LOG.debug("Got response '{}'", response);
exportJobReference = response.getJobReference();
} catch (IOException e) {
String error = String.format(
"Error while exporting table %s",
BigQueryStrings.toString(tableToExport.getTableReference()));
LOG.error(error, e);
throw new IOException(error, e);
}
}
示例3: handleResponse
import com.google.api.services.bigquery.model.Job; //导入方法依赖的package包/类
@Override
public void handleResponse(Job response) throws IOException {
bigQueryHelper.checkJobIdEquality(job, response);
JobReference jobReference = response.getJobReference();
// Check that job is completed.
try {
BigQueryUtils.waitForJobCompletion(
bigQueryHelper.getRawBigquery(), projectId, jobReference, progressable);
} catch (InterruptedException e) {
LOG.error(e.getMessage());
throw new IOException(e);
}
}