You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by dh...@apache.org on 2017/03/24 18:07:28 UTC
[1/2] beam git commit: [BEAM-1794] BigtableIO: update user agent
computation for new bigtable-client-core
Repository: beam
Updated Branches:
refs/heads/master 5903e6994 -> 804440826
[BEAM-1794] BigtableIO: update user agent computation for new bigtable-client-core
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/282c3ff2
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/282c3ff2
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/282c3ff2
Branch: refs/heads/master
Commit: 282c3ff2d599d23eeb7ad8aaa5af26f9020fc3f4
Parents: 5903e69
Author: Dan Halperin <dh...@google.com>
Authored: Wed Mar 22 10:21:33 2017 -0700
Committer: Dan Halperin <dh...@google.com>
Committed: Fri Mar 24 11:07:15 2017 -0700
----------------------------------------------------------------------
.../beam/sdk/io/gcp/bigtable/BigtableIO.java | 24 +++++++++++---------
1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam/blob/282c3ff2/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
index 9d02f65..a052e09 100644
--- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
+++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
@@ -215,7 +215,8 @@ public class BigtableIO {
// Set data channel count to one because there is only 1 scanner in this session
BigtableOptions.Builder clonedBuilder = options.toBuilder()
.setDataChannelCount(1);
- BigtableOptions optionsWithAgent = clonedBuilder.setUserAgent(getUserAgent()).build();
+ BigtableOptions optionsWithAgent =
+ clonedBuilder.setUserAgent(getBeamSdkPartOfUserAgent()).build();
return new Read(optionsWithAgent, tableId, keyRange, filter, bigtableService);
}
@@ -449,7 +450,8 @@ public class BigtableIO {
options.getBulkOptions().toBuilder()
.setUseBulkApi(true)
.build());
- BigtableOptions optionsWithAgent = clonedBuilder.setUserAgent(getUserAgent()).build();
+ BigtableOptions optionsWithAgent =
+ clonedBuilder.setUserAgent(getBeamSdkPartOfUserAgent()).build();
return new Write(optionsWithAgent, tableId, bigtableService);
}
@@ -1047,16 +1049,16 @@ public class BigtableIO {
}
/**
- * A helper function to produce a Cloud Bigtable user agent string.
+ * A helper function to produce a Cloud Bigtable user agent string. This need only include
+ * information about the Apache Beam SDK itself, because Bigtable will automatically append
+ * other relevant system and Bigtable client-specific version information.
+ *
+ * @see com.google.cloud.bigtable.config.BigtableVersionInfo
*/
- private static String getUserAgent() {
- String javaVersion = System.getProperty("java.specification.version");
+ private static String getBeamSdkPartOfUserAgent() {
ReleaseInfo info = ReleaseInfo.getReleaseInfo();
- return String.format(
- "%s/%s (%s); %s",
- info.getName(),
- info.getVersion(),
- javaVersion,
- "0.3.0" /* TODO get Bigtable client version directly from jar. */);
+ return
+ String.format("%s/%s", info.getName(), info.getVersion())
+ .replace(" ", "_");
}
}
[2/2] beam git commit: This closes #2306
Posted by dh...@apache.org.
This closes #2306
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/80444082
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/80444082
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/80444082
Branch: refs/heads/master
Commit: 804440826e9a5dabfaa772dca900feaf3dd6e3b7
Parents: 5903e69 282c3ff
Author: Dan Halperin <dh...@google.com>
Authored: Fri Mar 24 11:07:18 2017 -0700
Committer: Dan Halperin <dh...@google.com>
Committed: Fri Mar 24 11:07:18 2017 -0700
----------------------------------------------------------------------
.../beam/sdk/io/gcp/bigtable/BigtableIO.java | 24 +++++++++++---------
1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------