GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — chore: Pre-DIREGAPIC Refactoring #1 by vam-google · Pull Request #719 · googleapis/sdk-platform-java
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
Conversation
|
Codecov Report
@@ Coverage Diff @@ ## master #719 +/- ## ========================================== + Coverage 92.30% 92.48% +0.18% ========================================== Files 124 127 +3 Lines 13491 13501 +10 Branches 996 981 -15 ========================================== + Hits 12453 12487 +34 + Misses 786 773 -13 + Partials 252 241 -11
Continue to review full report at Codecov.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| .setExtendsType( | ||
| TypeNode.withReference( | ||
| FIXED_TYPESTORE | ||
| getFixedTypeStore() |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Curious - what is the motivation for using a getter if the field is immutable?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Also just basically a best practice thing for java - do not use protected fields, use protected setter/getter for them instead. This field can't be private, because it is accessed in the subclasses, so it must be either protected or have a protected getter, which is what is done here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Leaving open to revisit after the upcoming changes - if this becomes unneeded by the transport-specific composers, consider making it inaccessible to the subclasses.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| TypeStore fixedTypeStore, | ||
| Class<?> instantiatingChannelProviderClass, | ||
| String defaultTransportProviderBuilderName) { | ||
| this.fixedTypeStore = fixedTypeStore; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
WDYT about instantiating the intersection of gRPC and REST types in this class's fixedTypeStore? Looks like each call to fixedTypeStore.get() in this file could be a good starter set.
In response to this comment: Good point on sticking with fixedTypeStore.get("Test"). Previously, type existence was guaranteed because fixedTypeStore was instantiated in the same class, which is no longer the case. Hence setting up the common types will address this area.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm not sure I understand your comment instantiating the intersection of gRPC and REST types.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| String defaultTransportProviderBuilderName) { | ||
| this.fixedTypeStore = fixedTypeStore; | ||
| this.instantiatingChannelProviderClass = instantiatingChannelProviderClass; | ||
| this.defaultTransportProviderBuilderName = defaultTransportProviderBuilderName; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Responding to this comment:
To recap, we currently have three possible approaches:
defaultTransportProviderBuilderName = "defaultGrpcTransportProviderBuilder" (current approach in this PR).
ClassNames is later involved, there will be another potential set of classes to look up."Grpc" or "HttpJson" in the string (most suboptimal).
My $0.02: The per-transport context object doesn't have to hold all the state, just anything that needed to be passed into the superclass. Motivation: Passing in differing string values in each per-transport composer class may possibly be less maintainable, especially since the values change within the same transport (e.g. "gRPC" vs "Grpc").
We can also discuss more offline. :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I can do the contexts, no problem, two questions before doing it (we can discuss it via GVC, just mentioning it here to not forget it):
Please clarify what you mean by context maximizing per-transport locality?
Yes, the context will need to hold the stuff to be passed to the superclass, but there are multiple superlcasses (like 5+) and each of them needs a different set of things (with some intersection, but not much). This means we will either need 5+ different transport specific contexts, or one transport-specific context with stuff shared across different composers in, which will tightly couple the composers class hierarchy with the context and with each other.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| super( | ||
| createTypes(), | ||
| InstantiatingGrpcChannelProvider.Builder.class, | ||
| "defaultGrpcTransportProviderBuilder"); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
super(InstantiatingGrpcChannelProvider.Builder.class,
"defaultGrpcTransportProviderBuilder");
secondFixedTypeStore.add(...);
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| TypeStore fixedTypeStore, | ||
| Class<?> instantiatingChannelProviderClass, | ||
| String defaultTransportProviderBuilderName) { | ||
| this.fixedTypeStore = fixedTypeStore; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Mainly introduce TransportContex and all related stuff.
Mainly introduce TransportContex and all related stuff.
|
@miraleung PTAL |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Given the scope of DIREGAPIC's refactorings, could we start a diregapic main branch for all the refactoring PRs, so we can merge that into master when it's all done?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| GRPC, | ||
| GRPC_REST; | ||
|
|
||
| public static Transport parse(String name) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nit: Consider adding a comment with the expected input. As someone familiar with what we're doing, it looks like this will be parsing a Bazel param string like "grpc+rest", so it'd be great to document this method's usage.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will in the PR which will introduce the actual parameters (here it is just hardcoded everywhere as grpc for now, because unill regapic prs are merged, grpc is the only actually supported transport by the generator.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-core](https://togithub.com/googleapis/java-core) | `2.7.1` -> `2.8.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-core-bom](https://togithub.com/googleapis/java-core) | `2.7.1` -> `2.8.0` | [](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>googleapis/java-core</summary> ### [`v2.8.0`](https://togithub.com/googleapis/java-core/blob/HEAD/CHANGELOG.md#​280-httpsgithubcomgoogleapisjava-corecomparev271v280-2022-06-21) [Compare Source](https://togithub.com/googleapis/java-core/compare/v2.7.1...v2.8.0) ##### Features - add build scripts for native image testing in Java 17 ([#​1440](https://togithub.com/googleapis/java-core/issues/1440)) ([#​836](https://togithub.com/googleapis/java-core/issues/836)) ([8826d9b](https://togithub.com/googleapis/java-core/commit/8826d9bc05eb9e4a54c40e8578de85ed79c50e99)) ##### Dependencies - update dependency com.google.api-client:google-api-client-bom to v1.35.1 ([#​843](https://togithub.com/googleapis/java-core/issues/843)) ([9ffe0c5](https://togithub.com/googleapis/java-core/commit/9ffe0c5b25761abf7ff1bea091aa1db057dff2d0)) - update dependency com.google.api:api-common to v2.2.1 ([#​844](https://togithub.com/googleapis/java-core/issues/844)) ([69dde56](https://togithub.com/googleapis/java-core/commit/69dde5641546b678a385b1ed3a2c7a020f81d285)) - update dependency com.google.api:gax-bom to v2.18.2 ([#​849](https://togithub.com/googleapis/java-core/issues/849)) ([11764b0](https://togithub.com/googleapis/java-core/commit/11764b04629c5bfbc9b0d68174782cc126dc1646)) - update dependency com.google.api.grpc:proto-google-common-protos to v2.9.0 ([#​846](https://togithub.com/googleapis/java-core/issues/846)) ([5dced6d](https://togithub.com/googleapis/java-core/commit/5dced6d25ce0f3e7587d7ac1f6f3713f3b2a18c2)) - update dependency com.google.api.grpc:proto-google-iam-v1 to v1.4.0 ([#​838](https://togithub.com/googleapis/java-core/issues/838)) ([b0a7afe](https://togithub.com/googleapis/java-core/commit/b0a7afe342a5e15436d439b9cc1e3c58f894ab66)) - update dependency com.google.api.grpc:proto-google-iam-v1 to v1.4.1 ([#​848](https://togithub.com/googleapis/java-core/issues/848)) ([8260997](https://togithub.com/googleapis/java-core/commit/826099767b0aabe0db26eff2f612f0847b451366)) - update dependency com.google.errorprone:error_prone_annotations to v2.14.0 ([#​839](https://togithub.com/googleapis/java-core/issues/839)) ([3459fb6](https://togithub.com/googleapis/java-core/commit/3459fb668557b982cef5682ce47d3c978b83d69c)) - update dependency com.google.http-client:google-http-client-bom to v1.42.0 ([#​845](https://togithub.com/googleapis/java-core/issues/845)) ([2d2c873](https://togithub.com/googleapis/java-core/commit/2d2c873e274b26f4687d569cc3b8ae58c3c5ed54)) - update dependency com.google.protobuf:protobuf-bom to v3.21.0 ([#​840](https://togithub.com/googleapis/java-core/issues/840)) ([037da15](https://togithub.com/googleapis/java-core/commit/037da15b2aed1719e768ba5b4e001caf25952adc)) - update dependency com.google.protobuf:protobuf-bom to v3.21.1 ([#​841](https://togithub.com/googleapis/java-core/issues/841)) ([04b8862](https://togithub.com/googleapis/java-core/commit/04b886224128f1525ad8398815dc62dac87680af)) - update dependency io.grpc:grpc-bom to v1.47.0 ([#​842](https://togithub.com/googleapis/java-core/issues/842)) ([40984e2](https://togithub.com/googleapis/java-core/commit/40984e23242ba954b6ca741ca3f02ec89e92ae57)) ##### [2.7.1](https://togithub.com/googleapis/java-core/compare/v2.7.0...v2.7.1) (2022-05-19) ##### Dependencies - update dependency com.google.api:gax-bom to v2.18.1 ([#​833](https://togithub.com/googleapis/java-core/issues/833)) ([7541115](https://togithub.com/googleapis/java-core/commit/7541115095e0ae28d938a4c9621fd0f82892fe55)) </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 these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- 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-shared-dependencies).
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api:gax-bom](https://togithub.com/googleapis/gax-java) | `2.12.0` -> `2.12.2` | [](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>googleapis/gax-java</summary> ### [`v2.12.2`](https://togithub.com/googleapis/gax-java/blob/HEAD/CHANGELOG.md#​2122-httpsgithubcomgoogleapisgax-javacomparev2121v2122-2022-02-09) [Compare Source](https://togithub.com/googleapis/gax-java/compare/v2.12.1...v2.12.2) ### [`v2.12.1`](https://togithub.com/googleapis/gax-java/blob/HEAD/CHANGELOG.md#​2121-httpsgithubcomgoogleapisgax-javacomparev2120v2121-2022-02-09) [Compare Source](https://togithub.com/googleapis/gax-java/compare/v2.12.0...v2.12.1) </details> --- ### Configuration 📅 **Schedule**: 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, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-core).
🤖 I have created a release *beep* *boop* --- ### [2.5.3](googleapis/java-core@v2.5.2...v2.5.3) (2022-02-10) ### Dependencies * update dependency com.google.api:gax-bom to v2.12.2 ([#719](googleapis/java-core#719)) ([8c14b98](googleapis/java-core@8c14b98)) * update dependency com.google.http-client:google-http-client-bom to v1.41.3 ([#720](googleapis/java-core#720)) ([8addf7f](googleapis/java-core@8addf7f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.