@Override public com.google.api.services.bigquery.model.Job call() { return bigQueryRpc.getJob( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation(), optionsMap); } },
@Override public Boolean call() { return bigQueryRpc.cancel( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation()); } },
JobId setProjectId(String projectId) { return getProject() != null ? this : toBuilder().setProject(projectId).build(); }
@Override public GetQueryResultsResponse call() { return serviceOptions .getBigQueryRpcV2() .getQueryResults( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation(), optionsMap); } },
private void compareJobs(JobId expected, JobId value) { assertEquals(expected, value); assertEquals(expected.hashCode(), value.hashCode()); assertEquals(expected.toString(), value.toString()); assertEquals(expected.getProject(), value.getProject()); assertEquals(expected.getJob(), value.getJob()); assertEquals(expected.hashCode(), value.hashCode()); } }
JobReference toPb() { return new JobReference() .setProjectId(getProject()) .setJobId(getJob()) .setLocation(getLocation()); }
@Test public void testOf() { assertEquals(null, JOB.getProject()); assertEquals("job", JOB.getJob()); assertEquals("project", JOB_COMPLETE.getProject()); assertEquals("job", JOB_COMPLETE.getJob()); }
@Test public void testSetProjectId() { JobInfo jobInfo = COPY_JOB.setProjectId("p"); assertEquals("p", jobInfo.getJobId().getProject()); CopyJobConfiguration copyConfiguration = jobInfo.getConfiguration(); assertEquals("p", copyConfiguration.getDestinationTable().getProject()); for (TableId sourceTable : copyConfiguration.getSourceTables()) { assertEquals("p", sourceTable.getProject()); } jobInfo = EXTRACT_JOB.setProjectId("p"); assertEquals("p", jobInfo.getJobId().getProject()); ExtractJobConfiguration extractConfiguration = jobInfo.getConfiguration(); assertEquals("p", extractConfiguration.getSourceTable().getProject()); jobInfo = LOAD_JOB.setProjectId("p"); assertEquals("p", jobInfo.getJobId().getProject()); LoadJobConfiguration loadConfiguration = jobInfo.getConfiguration(); assertEquals("p", loadConfiguration.getDestinationTable().getProject()); jobInfo = QUERY_JOB.setProjectId("p"); assertEquals("p", jobInfo.getJobId().getProject()); QueryJobConfiguration queryConfiguration = jobInfo.getConfiguration(); assertEquals("p", queryConfiguration.getDefaultDataset().getProject()); assertEquals("p", queryConfiguration.getDestinationTable().getProject()); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof JobId) { JobId that = (JobId) o; return ((this.project == null) ? (that.getProject() == null) : this.project.equals(that.getProject())) && ((this.job == null) ? (that.getJob() == null) : this.job.equals(that.getJob())) && ((this.location == null) ? (that.getLocation() == null) : this.location.equals(that.getLocation())); } return false; }
private Builder(JobId source) { this.project = source.getProject(); this.job = source.getJob(); this.location = source.getLocation(); } @Override
@Override public com.google.api.services.bigquery.model.Job call() { return bigQueryRpc.getJob( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation(), optionsMap); } },
@Override public Boolean call() { return bigQueryRpc.cancel( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation()); } },
JobId setProjectId(String projectId) { return getProject() != null ? this : toBuilder().setProject(projectId).build(); }
@Override public GetQueryResultsResponse call() { return serviceOptions .getBigQueryRpcV2() .getQueryResults( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation(), optionsMap); } },
JobReference toPb() { return new JobReference() .setProjectId(getProject()) .setJobId(getJob()) .setLocation(getLocation()); }