Removing transport from ServiceOptions hierarchy#1723
Removing transport from ServiceOptions hierarchy#1723garrettjonesgoogle merged 6 commits intogoogleapis:masterfrom
Conversation
This allows a client to support multiple transports in the future, e.g. Datastore supports http now but grpc support will be added later. Related changes: * Renaming HttpServiceOptions to HttpTransportOptions * Renaming GrpcServiceOptions to GrpcTransportOptions * Creating new TransportOptions interface
|
Changes Unknown when pulling a829b26 on garrettjonesgoogle:master into ** on GoogleCloudPlatform:master**. |
| * credentials. | ||
| */ | ||
| public static RemoteComputeHelper create() { | ||
| HttpTransportOptions transportOptions = ComputeOptions.getDefaultHttpTransportOptions(); |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @Override | ||
| protected int baseHashCode() { | ||
| return Objects.hash(super.baseHashCode(), executorFactoryClassName, initialTimeout, | ||
| public int hashCode() { |
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.
| && Objects.equals(executorFactoryClassName, other.executorFactoryClassName) | ||
| @Override | ||
| public boolean equals(Object obj) { | ||
| if (!(obj instanceof GrpcTransportOptions)) { |
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.
| getFromServiceLoader(rpcFactoryClass, getDefaultRpcFactory())); | ||
| serviceRpcFactoryClassName = serviceRpcFactory.getClass().getName(); | ||
| clock = firstNonNull(builder.clock, Clock.defaultClock()); | ||
| transportOptions = firstNonNull(builder.transportOptions, getDefaultTransportOptions()); |
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.
| super(options); | ||
| } | ||
|
|
||
| @Override |
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.
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.
| public static HttpTransportOptions getDefaultHttpTransportOptions() { | ||
| return HttpTransportOptions.newBuilder().build(); | ||
| } | ||
|
|
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.
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.
| assertThat(options.getPrefetchChunks()).isEqualTo(2); | ||
| } | ||
|
|
||
| class DummyTransportOptions implements TransportOptions { |
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.
| public static HttpTransportOptions getDefaultHttpTransportOptions() { | ||
| return HttpTransportOptions.newBuilder().build(); | ||
| } | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| super(options); | ||
| } | ||
|
|
||
| @Override |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Addressed PR feedback, PTAL |
|
Changes Unknown when pulling f638bab on garrettjonesgoogle:master into ** on GoogleCloudPlatform:master**. |
michaelbausor
left a comment
There was a problem hiding this comment.
Lots of the codacy-bot errors are unused imports, is these any easy way to clean them up?
|
|
||
| public DefaultBigQueryRpc(BigQueryOptions options) { | ||
| HttpTransportOptions transportOptions = options.getHttpTransportOptions(); | ||
| HttpTransportOptions transportOptions = (HttpTransportOptions) options.getTransportOptions(); |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
LGTM |
|
For the record: The Codacy warnings were already cleaned up before any reviews started. |
vam-google
left a comment
There was a problem hiding this comment.
LGTM, though the code duplication in setTransportOptions() method is still a concern for me (if not with an abstract class, i would still be happy to get rid from it somehow).
| @Override | ||
| public boolean equals(Object obj) { | ||
| if (!(obj instanceof HttpTransportOptions)) { | ||
| if (obj == null) { |
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.
#1723) * chore: Update generation configuration at Sat Jan 25 02:17:00 UTC 2025 * chore: Update generation configuration at Mon Jan 27 02:21:43 UTC 2025 * chore: Update generation configuration at Tue Jan 28 02:20:23 UTC 2025 * chore: Update generation configuration at Wed Jan 29 02:19:56 UTC 2025
* chore: add link to guide on enable debug logging * wording Co-authored-by: Lawrence Qiu <[email protected]> --------- Co-authored-by: Lawrence Qiu <[email protected]>
* chore: add link to guide on enable debug logging * wording Co-authored-by: Lawrence Qiu <[email protected]> --------- Co-authored-by: Lawrence Qiu <[email protected]>
googleapis#1723) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.springframework.boot:spring-boot](https://spring.io/projects/spring-boot) ([source](https://togithub.com/spring-projects/spring-boot)) | `3.3.2` -> `3.3.3` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>spring-projects/spring-boot (org.springframework.boot:spring-boot)</summary> ### [`v3.3.3`](https://togithub.com/spring-projects/spring-boot/compare/v3.3.2...v3.3.3) </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 was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/java-spanner-jdbc). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
…o v1.125.0 (#1723) * chore(deps): update dependency com.google.cloud:google-cloud-pubsub to v1.125.0 * 🦉 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>
…o v1.125.0 (#1723) * chore(deps): update dependency com.google.cloud:google-cloud-pubsub to v1.125.0 * 🦉 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>
Updates #1601
This allows a client to support multiple transports in the future,
e.g. Datastore supports http now but grpc support will be added
later.
Related changes: