本文整理了Java中com.google.api.services.bigquery.model.Job.getConfiguration()
方法的一些代码示例,展示了Job.getConfiguration()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getConfiguration()
方法的具体详情如下:
包路径:com.google.api.services.bigquery.model.Job
类名称:Job
方法名:getConfiguration
[英][Required] Describes the job configuration.
[中][必需]描述作业配置。
代码示例来源:origin: googleapis/google-cloud-java
BuilderImpl(Job jobPb) {
this.etag = jobPb.getEtag();
this.generatedId = jobPb.getId();
if (jobPb.getJobReference() != null) {
this.jobId = JobId.fromPb(jobPb.getJobReference());
}
this.selfLink = jobPb.getSelfLink();
if (jobPb.getStatus() != null) {
this.status = JobStatus.fromPb(jobPb.getStatus());
}
if (jobPb.getStatistics() != null) {
this.statistics = JobStatistics.fromPb(jobPb);
}
this.userEmail = jobPb.getUserEmail();
if (jobPb.getConfiguration() != null) {
this.configuration = JobConfiguration.fromPb(jobPb.getConfiguration());
}
}
代码示例来源:origin: googleapis/google-cloud-java
@SuppressWarnings("unchecked")
static <T extends JobStatistics> T fromPb(com.google.api.services.bigquery.model.Job jobPb) {
JobConfiguration jobConfigPb = jobPb.getConfiguration();
com.google.api.services.bigquery.model.JobStatistics statisticPb = jobPb.getStatistics();
if (jobConfigPb.getLoad() != null) {
return (T) LoadStatistics.fromPb(statisticPb);
} else if (jobConfigPb.getExtract() != null) {
return (T) ExtractStatistics.fromPb(statisticPb);
} else if (jobConfigPb.getQuery() != null) {
return (T) QueryStatistics.fromPb(statisticPb);
} else if (jobConfigPb.getCopy() != null) {
return (T) CopyStatistics.fromPb(statisticPb);
} else {
throw new IllegalArgumentException("unknown job configuration: " + jobConfigPb);
}
}
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testToPbAndFromPb() {
assertNotNull(COPY_JOB.toPb().getConfiguration().getCopy());
assertNull(COPY_JOB.toPb().getConfiguration().getExtract());
assertNull(COPY_JOB.toPb().getConfiguration().getLoad());
assertNull(COPY_JOB.toPb().getConfiguration().getQuery());
assertEquals(COPY_JOB_STATISTICS, JobStatistics.fromPb(COPY_JOB.toPb()));
compareJobInfo(COPY_JOB, JobInfo.fromPb(COPY_JOB.toPb()));
assertTrue(JobInfo.fromPb(COPY_JOB.toPb()).getConfiguration() instanceof CopyJobConfiguration);
assertNull(EXTRACT_JOB.toPb().getConfiguration().getCopy());
assertNotNull(EXTRACT_JOB.toPb().getConfiguration().getExtract());
assertNull(EXTRACT_JOB.toPb().getConfiguration().getLoad());
assertNull(EXTRACT_JOB.toPb().getConfiguration().getQuery());
assertEquals(EXTRACT_JOB_STATISTICS, JobStatistics.fromPb(EXTRACT_JOB.toPb()));
compareJobInfo(EXTRACT_JOB, JobInfo.fromPb(EXTRACT_JOB.toPb()));
JobInfo.fromPb(EXTRACT_JOB.toPb()).getConfiguration() instanceof ExtractJobConfiguration);
assertTrue(JobInfo.fromPb(EXTRACT_JOB.toPb()).getStatistics() instanceof ExtractStatistics);
assertNull(LOAD_JOB.toPb().getConfiguration().getCopy());
assertNull(LOAD_JOB.toPb().getConfiguration().getExtract());
assertNotNull(LOAD_JOB.toPb().getConfiguration().getLoad());
assertNull(LOAD_JOB.toPb().getConfiguration().getQuery());
assertEquals(LOAD_JOB_STATISTICS, JobStatistics.fromPb(LOAD_JOB.toPb()));
compareJobInfo(LOAD_JOB, JobInfo.fromPb(LOAD_JOB.toPb()));
assertTrue(JobInfo.fromPb(LOAD_JOB.toPb()).getConfiguration() instanceof LoadJobConfiguration);
assertTrue(JobInfo.fromPb(LOAD_JOB.toPb()).getStatistics() instanceof LoadStatistics);
assertNull(QUERY_JOB.toPb().getConfiguration().getCopy());
assertNull(QUERY_JOB.toPb().getConfiguration().getExtract());
assertNull(QUERY_JOB.toPb().getConfiguration().getLoad());
assertNotNull(QUERY_JOB.toPb().getConfiguration().getQuery());
代码示例来源:origin: googleapis/google-cloud-java
.setId(JOB)
.setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE"));
jobResponsePb.getConfiguration().getQuery().setDestinationTable(TABLE_ID.toPb());
GetQueryResultsResponse responsePb =
new GetQueryResultsResponse()
代码示例来源:origin: googleapis/google-cloud-java
.setJobReference(queryJob.toPb())
.setId(JOB);
jobResponsePb1.getConfiguration().getQuery().setDestinationTable(TABLE_ID.toPb());
代码示例来源:origin: googleapis/google-cloud-java
.setId(JOB)
.setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE"));
jobResponsePb.getConfiguration().getQuery().setDestinationTable(TABLE_ID.toPb());
GetQueryResultsResponse responsePb =
new GetQueryResultsResponse()
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
static String jobToPrettyString(@Nullable Job job) throws IOException {
if (job != null && job.getConfiguration().getLoad() != null) {
// Removing schema and sourceUris from error messages for load jobs since these fields can be
// quite long and error message might not be displayed properly in runner specific logs.
job = job.clone();
job.getConfiguration().getLoad().setSchema(null);
job.getConfiguration().getLoad().setSourceUris(null);
}
return job == null ? "null" : job.toPrettyString();
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
private JobStatus runJob(Job job) throws InterruptedException, IOException {
if (job.getConfiguration().getLoad() != null) {
return runLoadJob(job.getJobReference(), job.getConfiguration().getLoad());
} else if (job.getConfiguration().getCopy() != null) {
return runCopyJob(job.getConfiguration().getCopy());
} else if (job.getConfiguration().getExtract() != null) {
return runExtractJob(job, job.getConfiguration().getExtract());
} else if (job.getConfiguration().getQuery() != null) {
return runQueryJob(job.getConfiguration().getQuery());
}
return new JobStatus().setState("DONE");
}
代码示例来源:origin: com.google.cloud/google-cloud-bigquery
@SuppressWarnings("unchecked")
static <T extends JobStatistics> T fromPb(com.google.api.services.bigquery.model.Job jobPb) {
JobConfiguration jobConfigPb = jobPb.getConfiguration();
com.google.api.services.bigquery.model.JobStatistics statisticPb = jobPb.getStatistics();
if (jobConfigPb.getLoad() != null) {
return (T) LoadStatistics.fromPb(statisticPb);
} else if (jobConfigPb.getExtract() != null) {
return (T) ExtractStatistics.fromPb(statisticPb);
} else if (jobConfigPb.getQuery() != null) {
return (T) QueryStatistics.fromPb(statisticPb);
} else if (jobConfigPb.getCopy() != null) {
return (T) CopyStatistics.fromPb(statisticPb);
} else {
throw new IllegalArgumentException("unknown job configuration: " + jobConfigPb);
}
}
}
代码示例来源:origin: com.google.cloud/google-cloud-bigquery
BuilderImpl(Job jobPb) {
this.etag = jobPb.getEtag();
this.generatedId = jobPb.getId();
if (jobPb.getJobReference() != null) {
this.jobId = JobId.fromPb(jobPb.getJobReference());
}
this.selfLink = jobPb.getSelfLink();
if (jobPb.getStatus() != null) {
this.status = JobStatus.fromPb(jobPb.getStatus());
}
if (jobPb.getStatistics() != null) {
this.statistics = JobStatistics.fromPb(jobPb);
}
this.userEmail = jobPb.getUserEmail();
if (jobPb.getConfiguration() != null) {
this.configuration = JobConfiguration.fromPb(jobPb.getConfiguration());
}
}
代码示例来源:origin: com.spotify/scio-bigquery
return pollJob.getConfiguration().getQuery().getDestinationTable();
} else {
代码示例来源:origin: com.google.gcloud/gcloud-java-bigquery
BuilderImpl(Job jobPb) {
this.etag = jobPb.getEtag();
this.generatedId = jobPb.getId();
if (jobPb.getJobReference() != null) {
this.jobId = JobId.fromPb(jobPb.getJobReference());
}
this.selfLink = jobPb.getSelfLink();
if (jobPb.getStatus() != null) {
this.status = JobStatus.fromPb(jobPb.getStatus());
}
if (jobPb.getStatistics() != null) {
this.statistics = JobStatistics.fromPb(jobPb.getStatistics());
}
this.userEmail = jobPb.getUserEmail();
this.configuration = JobConfiguration.fromPb(jobPb.getConfiguration());
}
代码示例来源:origin: com.google.cloud/gcloud-java-bigquery
BuilderImpl(Job jobPb) {
this.etag = jobPb.getEtag();
this.generatedId = jobPb.getId();
if (jobPb.getJobReference() != null) {
this.jobId = JobId.fromPb(jobPb.getJobReference());
}
this.selfLink = jobPb.getSelfLink();
if (jobPb.getStatus() != null) {
this.status = JobStatus.fromPb(jobPb.getStatus());
}
if (jobPb.getStatistics() != null) {
this.statistics = JobStatistics.fromPb(jobPb.getStatistics());
}
this.userEmail = jobPb.getUserEmail();
this.configuration = JobConfiguration.fromPb(jobPb.getConfiguration());
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
.setMessage(
String.format(
"Job %s failed: %s", job.job.getConfiguration(), e.toString())));
List<ResourceId> sourceFiles =
filesForLoadJobs.get(jobRef.getProjectId(), jobRef.getJobId());
内容来源于网络,如有侵权,请联系作者删除!