You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/02/16 20:56:23 UTC

[GitHub] [beam] suztomo commented on a change in pull request #13990: [BEAM-11805] Replace user-agent for spanner

suztomo commented on a change in pull request #13990:
URL: https://github.com/apache/beam/pull/13990#discussion_r577131428



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerAccessor.java
##########
@@ -150,14 +187,34 @@ private static SpannerAccessor createAndConnect(SpannerConfig spannerConfig) {
     ValueProvider<String> host = spannerConfig.getHost();
     if (host != null) {
       builder.setHost(host.get());
+      instantiatingGrpcChannelProvider.setEndpoint(host.get());
     }
     ValueProvider<String> emulatorHost = spannerConfig.getEmulatorHost();
     if (emulatorHost != null) {
       builder.setEmulatorHost(emulatorHost.get());
       builder.setCredentials(NoCredentials.getInstance());
+    } else {
+      String userAgentString = USER_AGENT_PREFIX + "/" + ReleaseInfo.getReleaseInfo().getVersion();
+      /* Workaround to setup user-agent string.
+       * InstantiatingGrpcChannelProvider will override the settings provided.
+       * The section below and all associated artifacts will be removed once the bug
+       * that prevents setting user-agent is fixed.
+       * https://github.com/googleapis/java-spanner/pull/747

Review comment:
       Is this a link to a bug to be fixed (I see it's been merged already)?
   
   If not, would you also add the link to the bug?
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org