本文整理了Java中com.google.api.services.bigquery.model.Job.setKind()
方法的一些代码示例,展示了Job.setKind()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.setKind()
方法的具体详情如下:
包路径:com.google.api.services.bigquery.model.Job
类名称:Job
方法名:setKind
[英][Output-only] The type of the resource.
[中][仅输出]资源的类型。
代码示例来源:origin: googleapis/google-cloud-java
@Override
public Job apply(JobList.Jobs jobPb) {
JobStatus statusPb =
jobPb.getStatus() != null ? jobPb.getStatus() : new JobStatus();
if (statusPb.getState() == null) {
statusPb.setState(jobPb.getState());
}
if (statusPb.getErrorResult() == null) {
statusPb.setErrorResult(jobPb.getErrorResult());
}
return new Job()
.setConfiguration(jobPb.getConfiguration())
.setId(jobPb.getId())
.setJobReference(jobPb.getJobReference())
.setKind(jobPb.getKind())
.setStatistics(jobPb.getStatistics())
.setStatus(statusPb)
.setUserEmail(jobPb.getUserEmail());
}
}));
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
@Override
public void startLoadJob(JobReference jobRef, JobConfigurationLoad loadConfig)
throws IOException {
synchronized (allJobs) {
verifyUniqueJobId(jobRef.getJobId());
Job job = new Job();
job.setJobReference(jobRef);
job.setConfiguration(new JobConfiguration().setLoad(loadConfig));
job.setKind(" bigquery#job");
job.setStatus(new JobStatus().setState("PENDING"));
// Copy the files to a new location for import, as the temporary files will be deleted by
// the caller.
if (loadConfig.getSourceUris().size() > 0) {
ImmutableList.Builder<ResourceId> sourceFiles = ImmutableList.builder();
ImmutableList.Builder<ResourceId> loadFiles = ImmutableList.builder();
for (String filename : loadConfig.getSourceUris()) {
sourceFiles.add(FileSystems.matchNewResource(filename, false /* isDirectory */));
loadFiles.add(
FileSystems.matchNewResource(
filename + ThreadLocalRandom.current().nextInt(), false /* isDirectory */));
}
FileSystems.copy(sourceFiles.build(), loadFiles.build());
filesForLoadJobs.put(jobRef.getProjectId(), jobRef.getJobId(), loadFiles.build());
}
allJobs.put(jobRef.getProjectId(), jobRef.getJobId(), new JobInfo(job));
}
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
@Override
public void startExtractJob(JobReference jobRef, JobConfigurationExtract extractConfig)
throws IOException {
checkArgument(
"AVRO".equals(extractConfig.getDestinationFormat()), "Only extract to AVRO is supported");
synchronized (allJobs) {
verifyUniqueJobId(jobRef.getJobId());
++numExtractJobCalls;
Job job = new Job();
job.setJobReference(jobRef);
job.setConfiguration(new JobConfiguration().setExtract(extractConfig));
job.setKind(" bigquery#job");
job.setStatus(new JobStatus().setState("PENDING"));
allJobs.put(jobRef.getProjectId(), jobRef.getJobId(), new JobInfo(job));
}
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
@Override
public void startQueryJob(JobReference jobRef, JobConfigurationQuery query) {
synchronized (allJobs) {
Job job = new Job();
job.setJobReference(jobRef);
job.setConfiguration(new JobConfiguration().setQuery(query));
job.setKind(" bigquery#job");
job.setStatus(new JobStatus().setState("PENDING"));
allJobs.put(jobRef.getProjectId(), jobRef.getJobId(), new JobInfo(job));
}
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
@Override
public void startCopyJob(JobReference jobRef, JobConfigurationTableCopy copyConfig)
throws IOException {
synchronized (allJobs) {
verifyUniqueJobId(jobRef.getJobId());
Job job = new Job();
job.setJobReference(jobRef);
job.setConfiguration(new JobConfiguration().setCopy(copyConfig));
job.setKind(" bigquery#job");
job.setStatus(new JobStatus().setState("PENDING"));
allJobs.put(jobRef.getProjectId(), jobRef.getJobId(), new JobInfo(job));
}
}
代码示例来源:origin: com.google.gcloud/gcloud-java-bigquery
@Override
public Job apply(JobList.Jobs jobPb) {
JobStatus statusPb = jobPb.getStatus() != null
? jobPb.getStatus() : new JobStatus();
if (statusPb.getState() == null) {
statusPb.setState(jobPb.getState());
}
if (statusPb.getErrorResult() == null) {
statusPb.setErrorResult(jobPb.getErrorResult());
}
return new Job()
.setConfiguration(jobPb.getConfiguration())
.setId(jobPb.getId())
.setJobReference(jobPb.getJobReference())
.setKind(jobPb.getKind())
.setStatistics(jobPb.getStatistics())
.setStatus(statusPb)
.setUserEmail(jobPb.getUserEmail());
}
}));
代码示例来源:origin: com.google.cloud/google-cloud-bigquery
@Override
public Job apply(JobList.Jobs jobPb) {
JobStatus statusPb =
jobPb.getStatus() != null ? jobPb.getStatus() : new JobStatus();
if (statusPb.getState() == null) {
statusPb.setState(jobPb.getState());
}
if (statusPb.getErrorResult() == null) {
statusPb.setErrorResult(jobPb.getErrorResult());
}
return new Job()
.setConfiguration(jobPb.getConfiguration())
.setId(jobPb.getId())
.setJobReference(jobPb.getJobReference())
.setKind(jobPb.getKind())
.setStatistics(jobPb.getStatistics())
.setStatus(statusPb)
.setUserEmail(jobPb.getUserEmail());
}
}));
代码示例来源:origin: com.google.cloud/gcloud-java-bigquery
@Override
public Job apply(JobList.Jobs jobPb) {
JobStatus statusPb = jobPb.getStatus() != null
? jobPb.getStatus() : new JobStatus();
if (statusPb.getState() == null) {
statusPb.setState(jobPb.getState());
}
if (statusPb.getErrorResult() == null) {
statusPb.setErrorResult(jobPb.getErrorResult());
}
return new Job()
.setConfiguration(jobPb.getConfiguration())
.setId(jobPb.getId())
.setJobReference(jobPb.getJobReference())
.setKind(jobPb.getKind())
.setStatistics(jobPb.getStatistics())
.setStatus(statusPb)
.setUserEmail(jobPb.getUserEmail());
}
}));
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
for (int i = 0; i < 5; i++) {
Job currentJob = new Job();
currentJob.setKind(" bigquery#job");
PendingJob pendingJob =
new PendingJob(
内容来源于网络,如有侵权,请联系作者删除!