Conversation
Codecov Report@@ Coverage Diff @@
## master #179 +/- ##
============================================
+ Coverage 70.04% 70.38% +0.34%
- Complexity 460 463 +3
============================================
Files 64 64
Lines 2420 2418 -2
Branches 260 262 +2
============================================
+ Hits 1695 1702 +7
+ Misses 631 620 -11
- Partials 94 96 +2
Continue to review full report at Codecov.
|
| */ | ||
| public final class InstantiatingChannelProvider implements ChannelProvider { | ||
| private static final String DEFAULT_GAX_VERSION = "0.0.27"; | ||
| private static final String DEFAULT_GRPC_VERSION = "1.0.1"; |
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.
| "%s/%s %s/%s gax/%s java/%s", | ||
| clientLibName, | ||
| clientLibVersion, | ||
| "%s/%s gax/%s grpc/%s java/%s", |
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.
| // Default names and versions of the client and the service generator. | ||
| private static final String DEFAULT_GENERATOR_NAME = "gapic"; | ||
| private static final String DEFAULT_CLIENT_LIB_NAME = "gax"; | ||
| private static final String DEFAULT_CLIENT_LIB_NAME = "default"; |
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.
| String.format( | ||
| "gapic/0.1.0 gax/0.0.27 grpc/1.0.1 java/%s default/0.1.0", | ||
| Runtime.class.getPackage().getImplementationVersion()); | ||
| assertEquals(provider.serviceHeader(), expectedHeader); |
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.
|
I'll review this soon. The design doc is not fully baked, since there are still a few unresolved concerns. |
|
@bjwatson Friendly ping~ |
|
Thanks for the updates @shinfan. I'm reviewing now. |
| */ | ||
| public final class InstantiatingChannelProvider implements ChannelProvider { | ||
| private static final String DEFAULT_GAX_VERSION = "UNKNOWN"; | ||
| private static final String DEFAULT_GRPC_VERSION = "1.0.1"; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| // Default names and versions of the client and the service generator. | ||
| private static final String DEFAULT_GENERATOR_NAME = "gapic"; | ||
| private static final String DEFAULT_CLIENT_LIB_NAME = "gax"; | ||
| private static final String DEFAULT_CLIENT_LIB_NAME = "default"; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
bjwatson
left a comment
There was a problem hiding this comment.
Mostly looks good. We might move gl-java to the beginning of the list (see the email thread today). I just have a few requested changes, and want to confirm that corresponding toolkit changes are also needed.
| @@ -159,6 +150,22 @@ public boolean shouldAutoClose() { | |||
| } | |||
|
|
|||
| @VisibleForTesting | |||
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.
| @RunWith(JUnit4.class) | ||
| public class InstantiatingChannelProviderTest { | ||
|
|
||
| @Test |
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.serviceGeneratorName = name; | ||
| this.serviceGeneratorVersion = version; | ||
| /** Sets the generator name and version for the GRPC custom header. */ | ||
| public Builder setClientHeader(String name, String version) { |
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.
| String grpcVersion = ManagedChannel.class.getPackage().getImplementationVersion(); | ||
| if (grpcVersion == null) { | ||
| grpcVersion = DEFAULT_GRPC_VERSION; | ||
| } |
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.
| grpcVersion = DEFAULT_GRPC_VERSION; | ||
| } | ||
|
|
||
| String javaVersion = Runtime.class.getPackage().getImplementationVersion(); |
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.
|
@bjwatson PTAL |
|
LGTM |
| String clientLibName, | ||
| String clientLibVersion, | ||
| String serviceGeneratorName, | ||
| String serviceGeneratorVersion) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Because the gccl version implies the gapic version for all source delivery
languages. When you switch Datastore to use GAPIC, then you'll know the
gccl version as of which that happened. (Of course we'll need to keep track
of this somehow)
You can add the gapic version to the header if you really want to, but be
aware that you're adding some server overhead to every call without
providing any additional information.
On Feb 9, 2017 10:13 AM, "garrettjonesgoogle" <notifications@github.com> wrote:
*@garrettjonesgoogle* commented on this pull request.
------------------------------
In src/main/java/com/google/api/gax/grpc/InstantiatingChannelProvider.java
<#179 (review)>
:
private InstantiatingChannelProvider(
ExecutorProvider executorProvider,
CredentialsProvider credentialsProvider,
String serviceAddress,
int port,
- String clientLibName,
- String clientLibVersion,
- String serviceGeneratorName,
- String serviceGeneratorVersion) {
I still don't understand why we aren't retaining both the gapic version and
the gccl version when both are relevant. There is a particular scenario I
want recorded: Datastore as of now uses the legacy Google API Client stack,
thus it would have gccl and not gapic; but, when we switch it to using a
GAPIC client, then I want gccl and gapic to both appear.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#179 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAcyy2Nd2KbdwteTqxXErxGBw9CA78GSks5ra1ddgaJpZM4Lrdvu>
.
|
That's the part that concerns me. I don't want to track this.
But it actually is additional information - information that is otherwise a chore to uncover, because it requires digging up old source code revisions to find it out. Think of this scenario: there could be cases where we regenerate some GAPIC clients but not others, and thus for a particular gccl version, the gapic version depends on the API. |
|
Oh and I forgot to mention the scenario of an API starting with GAPIC-only, then converting to having a handwritten layer. In that case, the gapic version would disappear and there would be no continuity. |
|
@garrettjonesgoogle PTAL |
|
LGTM |
| // Default names and versions of the client and the service generator. | ||
| // Default names and versions of the service generator. | ||
| private static final String DEFAULT_GENERATOR_NAME = "gapic"; | ||
| private static final String DEFAULT_CLIENT_LIB_NAME = "gax"; |
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.
Now the gapic header has the following format:
Gapic only client: gl-java/{java_version} gapic/0.1.0 gax/0.0.27 grpc/1.0.1
Hand-written client: gl-java/{java_version} gccl/0.0.0 gapic/0.1.0 gax/0.0.27 grpc/1.0.1
The hand-written layer can override the top level token 'gapic/0.1.0' by setting the client name/version.