当前位置: 首页>>代码示例>>Java>>正文


Java Job.getJobReference方法代码示例

本文整理汇总了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;
}
 
开发者ID:google,项目名称:nomulus,代码行数:19,代码来源:BigqueryConnection.java

示例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);
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:bigdata-interop,代码行数:36,代码来源:AbstractExportToCloudStorage.java

示例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);
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:bigdata-interop,代码行数:14,代码来源:BigQueryRecordWriter.java


注:本文中的com.google.api.services.bigquery.model.Job.getJobReference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。