Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add whenDone method and CompletionCallback to Job and Operation #1016

Merged
merged 7 commits into from
Jun 9, 2016

Conversation

mziccard
Copy link
Contributor

@mziccard mziccard commented May 19, 2016

This PR adds a friendly method to wait for Job and Operation to complete, in the current thread. Methods accept a callback that can be used to react to job/operation failure or success. This fixes #963.

/cc @jgeewax @lesv

@mziccard mziccard added api: bigquery Issues related to the BigQuery API. api: compute Issues related to the Compute Engine API. labels May 19, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 19, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 85.987% when pulling e29f635 on mziccard:when-done into d5cf726 on GoogleCloudPlatform:master.

* @throws InterruptedException if the current thread gets interrupted while waiting for the job
* to complete
*/
public void whenDone(CompletionCallback callback) throws InterruptedException {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 85.972% when pulling c3ce162 on mziccard:when-done into fceeb65 on GoogleCloudPlatform:master.

@mziccard
Copy link
Contributor Author

In c3ce162 I removed whenDone as well as the callback class. Instead, I added two blocking methods (waitFor and waitFor(int, TimeUnit)) that return the completed job/operation (on null if not found).

You should like this better no :)

import com.google.cloud.compute.Snapshot;

Compute compute = ComputeOptions.defaultInstance().service();
final Compute compute = ComputeOptions.defaultInstance().service();

This comment was marked as spam.

This comment was marked as spam.

@aozarov
Copy link
Contributor

aozarov commented May 23, 2016

Yes, I like it. One more suggestion and javadoc needs some cleanup.

@lesv
Copy link
Contributor

lesv commented May 27, 2016

ping

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 86.043% when pulling e5af988 on mziccard:when-done into 11f4573 on GoogleCloudPlatform:master.

@mziccard
Copy link
Contributor Author

In e5af988 I added vararg options for both the checking period and the timeout. How do you like it now?

I had to rebase to fix conflicts and trigger CI.

*/
public Operation waitFor(WaitForOption... waitOptions)
throws InterruptedException, TimeoutException {
Map<WaitForOption.Option, ?> optionMap = WaitForOption.asMap(waitOptions);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 86.05% when pulling 71cd868 on mziccard:when-done into 11f4573 on GoogleCloudPlatform:master.

@aozarov
Copy link
Contributor

aozarov commented Jun 3, 2016

I like the change now! I will leave it to @lesv to do a thorough review but looks good to me.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 86.085% when pulling 996bae5 on mziccard:when-done into 11f4573 on GoogleCloudPlatform:master.

@lesv
Copy link
Contributor

lesv commented Jun 7, 2016

LGTM

@mziccard mziccard merged commit 3b35a9e into googleapis:master Jun 9, 2016
github-actions bot pushed a commit that referenced this pull request Aug 16, 2022
…14.5 (#1016)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.14.3` -> `2.14.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.6/compatibility-slim/2.14.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.6/confidence-slim/2.14.3)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-aiplatform).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNTguMCIsInVwZGF0ZWRJblZlciI6IjMyLjE1OC4wIn0=-->
github-actions bot pushed a commit that referenced this pull request Sep 19, 2022
🤖 I have created a release *beep* *boop*
---


## [3.3.0](googleapis/java-aiplatform@v3.2.0...v3.3.0) (2022-09-15)


### Features

* add input_artifacts to PipelineJob.runtime_config in aiplatform v1 pipeline_job ([ff7a4ab](googleapis/java-aiplatform@ff7a4ab))
* Add model_monitoring_stats_anomalies,model_monitoring_status to BatchPredictionJob in aiplatform v1beta1 batch_prediction_job.proto ([#1041](googleapis/java-aiplatform#1041)) ([fe03c60](googleapis/java-aiplatform@fe03c60))
* Add read_mask to ListPipelineJobsRequest in aiplatform v1 pipeline_service ([#1032](googleapis/java-aiplatform#1032)) ([ff7a4ab](googleapis/java-aiplatform@ff7a4ab))
* Add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1 index_service.proto ([#1030](googleapis/java-aiplatform#1030)) ([4114021](googleapis/java-aiplatform@4114021))
* add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1beta1 index_service.proto ([4114021](googleapis/java-aiplatform@4114021))
* Add WriteFeatureValues in aiplatform v1beta1 featurestore_online_service.proto ([#1022](googleapis/java-aiplatform#1022)) ([267827e](googleapis/java-aiplatform@267827e))


### Dependencies

* Update dependency com.google.api.grpc:proto-google-cloud-aiplatform-v1beta1 to v0.18.0 ([#1021](googleapis/java-aiplatform#1021)) ([c3d34a0](googleapis/java-aiplatform@c3d34a0))
* Update dependency com.google.cloud:google-cloud-bigquery to v2.14.5 ([#1016](googleapis/java-aiplatform#1016)) ([cc0af7b](googleapis/java-aiplatform@cc0af7b))
* Update dependency com.google.cloud:google-cloud-bigquery to v2.14.6 ([#1026](googleapis/java-aiplatform#1026)) ([6ed66cc](googleapis/java-aiplatform@6ed66cc))
* Update dependency com.google.cloud:google-cloud-bigquery to v2.14.7 ([#1031](googleapis/java-aiplatform#1031)) ([5adefd4](googleapis/java-aiplatform@5adefd4))
* Update dependency com.google.cloud:google-cloud-bigquery to v2.15.0 ([#1040](googleapis/java-aiplatform#1040)) ([b6c1b20](googleapis/java-aiplatform@b6c1b20))
* Update dependency com.google.cloud:google-cloud-bigquery to v2.16.0 ([#1044](googleapis/java-aiplatform#1044)) ([5ce52e5](googleapis/java-aiplatform@5ce52e5))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#1043](googleapis/java-aiplatform#1043)) ([40eae55](googleapis/java-aiplatform@40eae55))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#1045](googleapis/java-aiplatform#1045)) ([0f66302](googleapis/java-aiplatform@0f66302))
* Update dependency com.google.cloud:google-cloud-storage to v2.11.3 ([#1015](googleapis/java-aiplatform#1015)) ([7a2fcb0](googleapis/java-aiplatform@7a2fcb0))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit that referenced this pull request Oct 24, 2022
chore: remove check for flatten plugin

We have had the check for the flatten-maven-plugin in each
Cloud Java client repository. However, the behavior of the plugin
has been stable and its not each repository's responsibility to
assert the plugin's behavior. A new check is going to be added at
the googleapis/java-shared-config repository to assert the
plugin's behavior when we upgrade its version.
Source-Link: googleapis/synthtool@9266ddc
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:ae72564aa9c368b9ccd96f4af21f87889fd83b9e60635b80844deb5a2ccd08aa

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
github-actions bot pushed a commit to renovate-bot/google-cloud-java that referenced this pull request Nov 17, 2022
* cleanup: remove migrated sample

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
suztomo pushed a commit that referenced this pull request Feb 1, 2023
🤖 I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. api: compute Issues related to the Compute Engine API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide means to wait for an Operation/Job to complete
6 participants