-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 base service option classes for gRPC and HTTP services #1011
Add base service option classes for gRPC and HTTP services #1011
Conversation
1a35b69
to
6837e91
Compare
6837e91
to
76d11c0
Compare
/** | ||
* Shuts down the scheduled executor service if it is no longer used. | ||
*/ | ||
void shutdown(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Conceptually this looks fine too me. Didn't look too carefully at the details. |
import com.google.common.annotations.VisibleForTesting; | ||
import com.google.common.base.Preconditions; | ||
|
||
import io.grpc.internal.SharedResourceHolder; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Not a thorough review but I like it now! |
…s#1011) * Add base service option classes for gRPC and HTTP services * Rename ExecutorProvider to ExecutorFactory, refactor shutdown and serialization
…o v2.0.1 (#1011) [![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.api-client:google-api-client-bom](https://togithub.com/googleapis/google-api-java-client/tree/master/google-api-client-bom) ([source](https://togithub.com/googleapis/google-api-java-client)) | `2.0.0` -> `2.0.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api-client:google-api-client-bom/2.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api-client:google-api-client-bom/2.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api-client:google-api-client-bom/2.0.1/compatibility-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api-client:google-api-client-bom/2.0.1/confidence-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/google-api-java-client</summary> ### [`v2.0.1`](https://togithub.com/googleapis/google-api-java-client/blob/HEAD/CHANGELOG.md#​201-httpsgithubcomgoogleapisgoogle-api-java-clientcomparev200v201-2022-11-05) [Compare Source](https://togithub.com/googleapis/google-api-java-client/compare/v2.0.0...v2.0.1) ##### Bug Fixes - Add error description to batch emptiness validation ([#​2109](https://togithub.com/googleapis/google-api-java-client/issues/2109)) ([2668dd1](https://togithub.com/googleapis/google-api-java-client/commit/2668dd1348e7710a83e008b1e2b2ff6fceedfedf)) - **deps:** Update dependency com.google.api-client:google-api-client to v2 ([#​2108](https://togithub.com/googleapis/google-api-java-client/issues/2108)) ([570a162](https://togithub.com/googleapis/google-api-java-client/commit/570a1625fbb3806961d328d90d784b5f0ed21a0c)) - **deps:** Update dependency com.google.appengine:appengine-api-1.0-sdk to v2.0.10 ([#​2174](https://togithub.com/googleapis/google-api-java-client/issues/2174)) ([9077b4a](https://togithub.com/googleapis/google-api-java-client/commit/9077b4ae4c4214cb0fdcb5248f8c7ecbeb51d27f)) - **deps:** Update dependency com.google.appengine:appengine-api-1.0-sdk to v2.0.6 ([#​2124](https://togithub.com/googleapis/google-api-java-client/issues/2124)) ([51adc54](https://togithub.com/googleapis/google-api-java-client/commit/51adc541819284dabcdefef39fa39b4a0bd13f6a)) - **deps:** Update dependency com.google.appengine:appengine-api-1.0-sdk to v2.0.7 ([#​2131](https://togithub.com/googleapis/google-api-java-client/issues/2131)) ([6892bb2](https://togithub.com/googleapis/google-api-java-client/commit/6892bb293ca578b793fe0024c884b21e675abd45)) - **deps:** Update dependency com.google.appengine:appengine-api-1.0-sdk to v2.0.8 ([#​2140](https://togithub.com/googleapis/google-api-java-client/issues/2140)) ([bb6f19c](https://togithub.com/googleapis/google-api-java-client/commit/bb6f19ce2a89f6d419c908eff7faa944ea74799e)) - **deps:** Update dependency com.google.cloud:libraries-bom to v26.1.0 ([#​2126](https://togithub.com/googleapis/google-api-java-client/issues/2126)) ([3d0e0ff](https://togithub.com/googleapis/google-api-java-client/commit/3d0e0ff57cde5ca9eb56e5266dc5c37f3777179d)) - **deps:** Update dependency com.google.cloud:libraries-bom to v26.1.1 ([#​2134](https://togithub.com/googleapis/google-api-java-client/issues/2134)) ([15ce062](https://togithub.com/googleapis/google-api-java-client/commit/15ce06244a06b64545f145a2ebdfb62863fcbad4)) - **deps:** Update dependency com.google.cloud:libraries-bom to v26.1.2 ([#​2143](https://togithub.com/googleapis/google-api-java-client/issues/2143)) ([da2f6f3](https://togithub.com/googleapis/google-api-java-client/commit/da2f6f3e4645ff3b84465943833404526077ad20)) </details> --- ### 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**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- 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-core). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNy4xIiwidXBkYXRlZEluVmVyIjoiMzQuMTcuMSJ9-->
🤖 I have created a release *beep* *boop* --- ## [2.8.26](https://togithub.com/googleapis/java-core/compare/v2.8.25...v2.8.26) (2022-11-07) ### Dependencies * Update dependency com.google.api-client:google-api-client-bom to v2.0.1 ([#1011](https://togithub.com/googleapis/java-core/issues/1011)) ([bbcaed9](https://togithub.com/googleapis/java-core/commit/bbcaed9a9688a054adbb8d4615af14566b98a297)) * Update dependency com.google.api.grpc:proto-google-common-protos to v2.10.0 ([#1010](https://togithub.com/googleapis/java-core/issues/1010)) ([1f41e6b](https://togithub.com/googleapis/java-core/commit/1f41e6b9bf86ea94dbd0efda348d46f04e62baa4)) * Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.7 ([#1005](https://togithub.com/googleapis/java-core/issues/1005)) ([aac06c2](https://togithub.com/googleapis/java-core/commit/aac06c231ae59e4e913a228328202bdceda39ec4)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This PR follows from the discussion in #1005 and adds base service option classes specific for gRPC and HTTP transports (
HttpServiceOptions
andGrpcServiceOptions
).This PR also uses the features in the new
GrpcServiceOptions
base class to initializeDefaultPubSubRpc
.In the future we could consider exposing in
GrpcServiceOptions
a way of setting the executor, the only issue is see with this is that the classGrpcServiceOptions
must be serializable. We could consider not serializing the executor and using the default one (given that we document this behavior and suggest the user to usetoBuilder()
if he wants to set the executor before starting the service after de-serialization.@aozarov @ajkannan any kind of feedback is precious.