googleapis / googleapis/google-cloud-java

[java-bigquery] Update documentation for job.waitFor

Offen
#12,173 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: bigquery priority: p3
Vorherrschende Sprache
Java
Sterne
2.1k
Forks
1.2k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
154

Beschreibung

After [this commit](https://github.com/googleapis/java-bigquery/commit/2a0d86d2d07dd706fb7d943da6ebd5c9ac98dfca#diff-0a2f4a883a695233b6d143e64bb0b868d511d1c917f1a081281a9b16fd061c28 ) com.google.cloud.bigquery.Job.waitFor behavior changed significantly.
It starts to throws JobException/BigQueryException when there is any execution error in Job in reload method

However in many javadoc places and example code, following workflow is suggested, which does won't work anymore because BigQueryException is now being thrown in reload()
```
Job completedJob = job.waitFor();
if (completedJob == null) {
// job no longer exists
} else if (completedJob.getStatus().getError() != null) {
// job failed, handle error
} else {
// job completed successfully
}
```
Also method header

> public Job reload(JobOption... options)

and

> public Job waitFor(RetryOption... waitOptions) throws InterruptedException

should contain

> throws BigQueryException

I was much happier with previous way of dealing with job execution errors, but I assume it is too late to revert it back, so at least documentation should be right

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.