From 0e0e802f4fe44ce9c3bc8a203f3795862d35433d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Sep 2020 22:39:43 +0200 Subject: [PATCH 01/30] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v1.15.0 (#405) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f1b8e7e961..486fc339d9 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigtable - 1.14.0 + 1.15.0 From 39e17cc17c438f2d665875f9ff2b2cdf984e37b7 Mon Sep 17 00:00:00 2001 From: Dmitry <58846611+dmitry-fa@users.noreply.github.com> Date: Wed, 9 Sep 2020 01:35:54 +0300 Subject: [PATCH 02/30] fix: RowCells are not actually serializeable (#407) * fix: make RowCell serializable regardless given type of the labels parameter * fix: make RowCell serializable regardless given type of the labels parameter * optimization for an empty labels list --- .../bigtable/data/v2/models/RowCell.java | 9 +++- .../bigtable/data/v2/models/RowCellTest.java | 50 +++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java index 473c560b83..e4f3c635d3 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowCell.java @@ -20,6 +20,7 @@ import com.google.auto.value.AutoValue; import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator; import com.google.common.collect.ComparisonChain; +import com.google.common.collect.ImmutableList; import com.google.protobuf.ByteString; import java.io.Serializable; import java.util.Comparator; @@ -62,7 +63,13 @@ public static RowCell create( long timestamp, @Nonnull List labels, @Nonnull ByteString value) { - return new AutoValue_RowCell(family, qualifier, timestamp, value, labels); + // Ensure that the list is serializable and optimize for the common case + if (labels.isEmpty()) { + labels = ImmutableList.of(); + } else { + labels = ImmutableList.copyOf(labels); + } + return new AutoValue_RowCell(family, qualifier, timestamp, value, ImmutableList.copyOf(labels)); } /** The cell's family */ diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java index 96c78c2c33..f98e01e785 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java @@ -19,6 +19,14 @@ import com.google.common.collect.ImmutableList; import com.google.protobuf.ByteString; +import com.google.protobuf.LazyStringArrayList; +import com.google.protobuf.UnmodifiableLazyStringList; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Arrays; import java.util.Comparator; import java.util.List; import org.junit.Test; @@ -98,4 +106,46 @@ public void compareTest() { RowCell.create("family1", col1, timestamp2, labels1, value1))) .isEqualTo(1); } + + @Test + public void testSerialization() throws IOException, ClassNotFoundException { + LazyStringArrayList lazyList = new LazyStringArrayList(); + lazyList.add("lazy"); + lazyList.add("very lazy"); + List[] labelLists = { + Arrays.asList("str1", "str2", "str3"), + ImmutableList.of("string1", "string2"), + new UnmodifiableLazyStringList(lazyList), + new UnmodifiableLazyStringList(LazyStringArrayList.EMPTY) + }; + + for (int i = 0; i < labelLists.length; i++) { + String family = "family_" + i; + ByteString col = ByteString.copyFromUtf8("col_" + i); + long timestamp = 1000L * (i + 1); + List labels = labelLists[i]; + ByteString value = ByteString.copyFromUtf8("value_" + i); + RowCell cell = RowCell.create(family, col, timestamp, labels, value); + RowCell deserialized = (RowCell) serializeDeserialize(cell); + + assertThat(cell.getFamily()).isEqualTo(deserialized.getFamily()); + assertThat(cell.getQualifier()).isEqualTo(deserialized.getQualifier()); + assertThat(cell.getTimestamp()).isEqualTo(deserialized.getTimestamp()); + assertThat(cell.getLabels()).isEqualTo(deserialized.getLabels()); + assertThat(cell.getValue()).isEqualTo(deserialized.getValue()); + } + } + + private static Object serializeDeserialize(Object obj) + throws IOException, ClassNotFoundException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try (ObjectOutputStream outStream = new ObjectOutputStream(bos)) { + outStream.writeObject(obj); + } + + ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); + try (ObjectInputStream inStream = new ObjectInputStream(bis)) { + return inStream.readObject(); + } + } } From 010410f59ee40b8103556997c8038190ee3e2281 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 9 Sep 2020 14:10:03 +0000 Subject: [PATCH 03/30] chore: release 1.15.1-SNAPSHOT (#406) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- google-cloud-bigtable-bom/pom.xml | 14 +++++++------- google-cloud-bigtable-deps-bom/pom.xml | 2 +- google-cloud-bigtable-emulator/pom.xml | 8 ++++---- google-cloud-bigtable/pom.xml | 8 ++++---- grpc-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- grpc-google-cloud-bigtable-v2/pom.xml | 8 ++++---- pom.xml | 2 +- proto-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- proto-google-cloud-bigtable-v2/pom.xml | 8 ++++---- samples/snapshot/pom.xml | 2 +- versions.txt | 12 ++++++------ 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index 7bb0444ad0..b37a525fa7 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 1.15.0 + 1.15.1-SNAPSHOT pom com.google.cloud @@ -72,32 +72,32 @@ com.google.cloud google-cloud-bigtable - 1.15.0 + 1.15.1-SNAPSHOT com.google.cloud google-cloud-bigtable-emulator - 0.124.0 + 0.124.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 1.15.0 + 1.15.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-v2 - 1.15.0 + 1.15.1-SNAPSHOT com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 1.15.0 + 1.15.1-SNAPSHOT com.google.api.grpc proto-google-cloud-bigtable-v2 - 1.15.0 + 1.15.1-SNAPSHOT diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index 3c12565a0c..4f83b3eae7 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -12,7 +12,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.0 + 1.15.1-SNAPSHOT pom diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index feed747c3d..4a39dea576 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.124.0 + 0.124.1-SNAPSHOT Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 1.15.0 + 1.15.1-SNAPSHOT scm:git:git@github.com:googleapis/java-bigtable.git @@ -80,14 +80,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 0ba7a1d644..c72d32e424 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 1.15.0 + 1.15.1-SNAPSHOT jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,7 +12,7 @@ com.google.cloud google-cloud-bigtable-parent - 1.15.0 + 1.15.1-SNAPSHOT google-cloud-bigtable @@ -36,14 +36,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index a27712ee6a..b2a550d88d 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 1.15.0 + 1.15.1-SNAPSHOT grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 1.15.0 + 1.15.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index bb8015da65..32a03eb71e 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 1.15.0 + 1.15.1-SNAPSHOT grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 1.15.0 + 1.15.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import diff --git a/pom.xml b/pom.xml index ed134153c6..f2ba7a34a1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 1.15.0 + 1.15.1-SNAPSHOT Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index 63726b23ff..d4d6d31c5a 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 1.15.0 + 1.15.1-SNAPSHOT proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 1.15.0 + 1.15.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index a84a85e002..a157e532c8 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 1.15.0 + 1.15.1-SNAPSHOT proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 1.15.0 + 1.15.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 1.15.0 + 1.15.1-SNAPSHOT pom import diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bb697bfcdc..b3c552cd57 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 1.15.0 + 1.15.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 3918eab106..d5c69efbd8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:1.15.0:1.15.0 -grpc-google-cloud-bigtable-admin-v2:1.15.0:1.15.0 -grpc-google-cloud-bigtable-v2:1.15.0:1.15.0 -proto-google-cloud-bigtable-admin-v2:1.15.0:1.15.0 -proto-google-cloud-bigtable-v2:1.15.0:1.15.0 -google-cloud-bigtable-emulator:0.124.0:0.124.0 +google-cloud-bigtable:1.15.0:1.15.1-SNAPSHOT +grpc-google-cloud-bigtable-admin-v2:1.15.0:1.15.1-SNAPSHOT +grpc-google-cloud-bigtable-v2:1.15.0:1.15.1-SNAPSHOT +proto-google-cloud-bigtable-admin-v2:1.15.0:1.15.1-SNAPSHOT +proto-google-cloud-bigtable-v2:1.15.0:1.15.1-SNAPSHOT +google-cloud-bigtable-emulator:0.124.0:0.124.1-SNAPSHOT From 2e17f0a33aa4b3863c940fee551909f56f710acf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Sep 2020 22:07:37 +0200 Subject: [PATCH 04/30] chore(deps): update dependency com.google.cloud:libraries-bom to v10.1.0 (#412) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0e34671195..5f0438b486 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 10.0.0 + 10.1.0 pom import From 71dc8e3419fbb49d48bb7a3fd984d24e24661c81 Mon Sep 17 00:00:00 2001 From: Dmitry <58846611+dmitry-fa@users.noreply.github.com> Date: Mon, 14 Sep 2020 16:38:48 +0300 Subject: [PATCH 05/30] =?UTF-8?q?fix:=20Add=20documentation=20to=20bulkRea?= =?UTF-8?q?dRows=20that=20each=20batch=20will=20process=20t=E2=80=A6=20(#4?= =?UTF-8?q?10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Add documentation to bulkReadRows that each batch will process the keys sequentially * fix: Add documentation to bulkReadRows that each batch will process the keys sequentially * fix: Add documentation to bulkReadRows that each batch will process the keys sequentially --- .../admin/v2/BigtableTableAdminClient.java | 2 +- .../bigtable/data/v2/BigtableDataClient.java | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java index 0fffcc54fe..5d0350b9cf 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java @@ -76,7 +76,7 @@ * // One instance per application. * BigtableTableAdminClient client = BigtableTableAdminClient.create("[PROJECT]", "[INSTANCE]"); * - * CreateTable request = + * CreateTableRequest request = * CreateTableRequest.of("my-table") * .addFamily("cf1") * .addFamily("cf2", GCRULES.maxVersions(10)) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java index e249684244..04e1b15987 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java @@ -57,7 +57,7 @@ * // One instance per application. * BigtableDataClient client = BigtableDataClient.create("[PROJECT]", "[INSTANCE]") * - * for(Row row : client.readRows(Query.create("[TABLE]")) { + * for(Row row : client.readRows(Query.create("[TABLE]"))) { * // Do something with row * } * @@ -1077,9 +1077,13 @@ public Batcher newBulkMutationBatcher(@Nonnull String ta } /** - * Reads rows for given tableId in a batch. If the row does not exist, the value will be null. - * This operation should be called with in a single thread. The returned Batcher instance is not - * threadsafe, it can only be used from single thread. + * Reads rows for given tableId in a batch. If the row does not exist, the value will be null. The + * returned Batcher instance is not threadsafe, it can only be used from a single thread. + * + *

Performance notice: The ReadRows protocol requires that rows are sent in ascending key + * order, which means that the keys are processed sequentially on the server-side, so batching + * allows improving throughput but not latency. Lower latencies can be achieved by sending smaller + * requests concurrently. * *

Sample Code: * @@ -1113,8 +1117,13 @@ public Batcher newBulkReadRowsBatcher(String tableId) { /** * Reads rows for given tableId and filter criteria in a batch. If the row does not exist, the - * value will be null. This operation should be called with in a single thread. The returned - * Batcher instance is not threadsafe, it can only be used from single thread. + * value will be null. The returned Batcher instance is not threadsafe, it can only be used from a + * single thread. + * + *

Performance notice: The ReadRows protocol requires that rows are sent in ascending key + * order, which means that the keys are processed sequentially on the server-side, so batching + * allows improving throughput but not latency. Lower latencies can be achieved by sending smaller + * requests concurrently. * *

Sample Code: * From eb06b61fe20bd3e813ca613e11aec0441caaf60f Mon Sep 17 00:00:00 2001 From: kolea2 <45548808+kolea2@users.noreply.github.com> Date: Wed, 16 Sep 2020 18:29:20 +0000 Subject: [PATCH 06/30] chore: update CODEOWNERS (#413) * chore: update CODEOWNERS * update repo metadata --- .github/CODEOWNERS | 4 ++-- .repo-metadata.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2aee0146b5..a726cb3ad9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,8 +4,8 @@ # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax -# The @googleapis/bigtable-dpe is the default owner for changes in this repo -**/*.java @googleapis/bigtable-dpe +# The @googleapis/api-bigtable is the default owner for changes in this repo +**/*.java @googleapis/api-bigtable # The java-samples-reviewers team is the default owner for samples changes samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.repo-metadata.json b/.repo-metadata.json index 9d4c364693..238d7852fc 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -9,6 +9,6 @@ "repo": "googleapis/java-bigtable", "repo_short": "java-bigtable", "distribution_name": "com.google.cloud:google-cloud-bigtable", - "codeowner_team": "@googleapis/bigtable-dpe", + "codeowner_team": "@googleapis/api-bigtable", "api_id": "bigtable.googleapis.com" -} \ No newline at end of file +} From ad63449259d1858b8c2e63856bf4d5487cbea153 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 21 Sep 2020 14:45:32 -0700 Subject: [PATCH 07/30] build(ci): enable auto-release for dependency-update-only releases Automatically perform a Java client library release when: 1. Only dependency updates are going out in the release since any releases containing bug fixes, build changes or new features should be supervised; 2. There are no outstanding/open dependency update pull requests in the repo. This is to avoid multiple/redundant releases; 3. It is a SNAPSHOT release which is automatically generated post regular release -- this requires no human supervision. Testing done in 5 java-bigquery* client library repos. Example: [chore: release 0.3.4 ](https://github.com/googleapis/java-bigqueryconnection/pull/130) [chore: release 0.3.5-SNAPSHOT](https://github.com/googleapis/java-bigqueryconnection/pull/131) Source-Author: Stephanie Wang Source-Date: Thu Sep 17 15:30:02 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 538a68019eb4a36a0cdfa4021f324dd01b784395 Source-Link: https://github.com/googleapis/synthtool/commit/538a68019eb4a36a0cdfa4021f324dd01b784395 --- .github/workflows/auto-release.yaml | 69 +++++++++++++++++++++++++++++ synth.metadata | 5 ++- 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/auto-release.yaml diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml new file mode 100644 index 0000000000..d26427e468 --- /dev/null +++ b/.github/workflows/auto-release.yaml @@ -0,0 +1,69 @@ +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v3.0.0 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); \ No newline at end of file diff --git a/synth.metadata b/synth.metadata index 4d2ddc577b..ac1a5c25be 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "a56a0f8c9caf675b68d02587b042e1feeb261ccb" + "sha": "eb06b61fe20bd3e813ca613e11aec0441caaf60f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "019c7168faa0e56619f792693a8acdb30d6de19b" + "sha": "538a68019eb4a36a0cdfa4021f324dd01b784395" } } ], @@ -50,6 +50,7 @@ ".github/PULL_REQUEST_TEMPLATE.md", ".github/release-please.yml", ".github/trusted-contribution.yml", + ".github/workflows/auto-release.yaml", ".github/workflows/ci.yaml", ".github/workflows/samples.yaml", ".kokoro/build.bat", From 41c3754246f1135b966e68beec293111ef2a8d2f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 21 Sep 2020 15:50:05 -0700 Subject: [PATCH 08/30] chore(java): set yoshi-java as default CODEOWNER (#417) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/859d9a97-f544-49af-b5bb-6af06fb6542a/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/80003a3de2d8a75f5b47cb2e77e018f7f0f776cc --- .github/CODEOWNERS | 1 + synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a726cb3ad9..7c4d9ac88e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,6 +5,7 @@ # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax # The @googleapis/api-bigtable is the default owner for changes in this repo +* @googleapis/yoshi-java @googleapis/api-bigtable **/*.java @googleapis/api-bigtable # The java-samples-reviewers team is the default owner for samples changes diff --git a/synth.metadata b/synth.metadata index ac1a5c25be..375100f554 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "eb06b61fe20bd3e813ca613e11aec0441caaf60f" + "sha": "ad63449259d1858b8c2e63856bf4d5487cbea153" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "538a68019eb4a36a0cdfa4021f324dd01b784395" + "sha": "80003a3de2d8a75f5b47cb2e77e018f7f0f776cc" } } ], From 57edfde5eace28d50ec777e14589c9747616f0a8 Mon Sep 17 00:00:00 2001 From: Dmitry <58846611+dmitry-fa@users.noreply.github.com> Date: Tue, 22 Sep 2020 19:37:48 +0300 Subject: [PATCH 09/30] fix: Filters should be serializable (#397) * fix: Filters should be serializable * rollback changes to generated files * customize serialization of builders * customize serialization of builders * customize serialization of builders * check serialization of non-filter instances * test for spawned filters --- .../bigtable/data/v2/models/Filters.java | 87 +++++-- .../bigtable/data/v2/models/FiltersTest.java | 220 ++++++++++++++++++ 2 files changed, 293 insertions(+), 14 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Filters.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Filters.java index bd310cd2c5..4c82608545 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Filters.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Filters.java @@ -25,6 +25,9 @@ import com.google.cloud.bigtable.data.v2.models.Range.AbstractTimestampRange; import com.google.common.base.Preconditions; import com.google.protobuf.ByteString; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.io.Serializable; import javax.annotation.Nonnull; @@ -200,7 +203,19 @@ public Filter label(@Nonnull String label) { // Implementations of target specific filters. /** DSL for adding filters to a chain. */ public static final class ChainFilter implements Filter { - private RowFilter.Chain.Builder builder; + private static final long serialVersionUID = -6756759448656768478L; + private transient RowFilter.Chain.Builder builder; + + private void writeObject(ObjectOutputStream s) throws IOException { + s.defaultWriteObject(); + s.writeObject(builder.build()); + } + + private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { + s.defaultReadObject(); + RowFilter.Chain chain = (RowFilter.Chain) s.readObject(); + this.builder = chain.toBuilder(); + } private ChainFilter() { this.builder = RowFilter.Chain.newBuilder(); @@ -241,7 +256,19 @@ public ChainFilter clone() { /** DSL for adding filters to the interleave list. */ public static final class InterleaveFilter implements Filter { - private RowFilter.Interleave.Builder builder; + private static final long serialVersionUID = -6356151037337889421L; + private transient RowFilter.Interleave.Builder builder; + + private void writeObject(ObjectOutputStream s) throws IOException { + s.defaultWriteObject(); + s.writeObject(builder.build()); + } + + private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { + s.defaultReadObject(); + RowFilter.Interleave interleave = (RowFilter.Interleave) s.readObject(); + this.builder = interleave.toBuilder(); + } private InterleaveFilter() { builder = RowFilter.Interleave.newBuilder(); @@ -281,7 +308,19 @@ public InterleaveFilter clone() { /** DSL for configuring a conditional filter. */ public static final class ConditionFilter implements Filter { - private RowFilter.Condition.Builder builder; + private static final long serialVersionUID = -2720899822014446776L; + private transient RowFilter.Condition.Builder builder; + + private void writeObject(ObjectOutputStream s) throws IOException { + s.defaultWriteObject(); + s.writeObject(builder.build()); + } + + private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { + s.defaultReadObject(); + RowFilter.Condition condition = (RowFilter.Condition) s.readObject(); + this.builder = condition.toBuilder(); + } private ConditionFilter(@Nonnull Filter predicate) { Preconditions.checkNotNull(predicate); @@ -323,7 +362,9 @@ public ConditionFilter clone() { } } - public static final class KeyFilter { + public static final class KeyFilter implements Serializable { + private static final long serialVersionUID = 5137765114285539458L; + private KeyFilter() {} /** @@ -383,7 +424,9 @@ public Filter sample(double probability) { } } - public static final class FamilyFilter { + public static final class FamilyFilter implements Serializable { + private static final long serialVersionUID = -4470936841191831553L; + private FamilyFilter() {} /** @@ -405,7 +448,9 @@ public Filter exactMatch(@Nonnull String value) { } } - public static final class QualifierFilter { + public static final class QualifierFilter implements Serializable { + private static final long serialVersionUID = -1274850022909506559L; + private QualifierFilter() {} /** @@ -459,7 +504,8 @@ public QualifierRangeFilter rangeWithinFamily(@Nonnull String family) { /** Matches only cells from columns within the given range. */ public static final class QualifierRangeFilter - extends AbstractByteStringRange implements Filter, Serializable { + extends AbstractByteStringRange implements Filter { + private static final long serialVersionUID = -1909319911147913630L; private final String family; private QualifierRangeFilter(String family) { @@ -505,7 +551,9 @@ public QualifierRangeFilter clone() { } } - public static final class TimestampFilter { + public static final class TimestampFilter implements Serializable { + private static final long serialVersionUID = 5284219722591464991L; + private TimestampFilter() {} /** @@ -529,7 +577,9 @@ public TimestampRangeFilter exact(Long exactTimestamp) { /** Matches only cells with microsecond timestamps within the given range. */ public static final class TimestampRangeFilter - extends AbstractTimestampRange implements Filter, Serializable { + extends AbstractTimestampRange implements Filter { + private static final long serialVersionUID = 8410980338603335276L; + private TimestampRangeFilter() {} @InternalApi @@ -571,7 +621,9 @@ public TimestampRangeFilter clone() { } } - public static final class ValueFilter { + public static final class ValueFilter implements Serializable { + private static final long serialVersionUID = 6722715229238811179L; + private ValueFilter() {} /** @@ -628,7 +680,9 @@ public Filter strip() { /** Matches only cells with values that fall within the given value range. */ public static final class ValueRangeFilter extends AbstractByteStringRange - implements Filter, Serializable { + implements Filter { + private static final long serialVersionUID = -2452360677825047088L; + private ValueRangeFilter() {} @InternalApi @@ -668,7 +722,9 @@ public ValueRangeFilter clone() { } } - public static final class OffsetFilter { + public static final class OffsetFilter implements Serializable { + private static final long serialVersionUID = 3228791236971884041L; + private OffsetFilter() {} /** @@ -681,7 +737,9 @@ public Filter cellsPerRow(int count) { } } - public static final class LimitFilter { + public static final class LimitFilter implements Serializable { + private static final long serialVersionUID = -794915549003008940L; + private LimitFilter() {} /** @@ -705,6 +763,7 @@ public Filter cellsPerColumn(int count) { } private static final class SimpleFilter implements Filter { + private static final long serialVersionUID = 3595911451325189833L; private final RowFilter proto; private SimpleFilter(@Nonnull RowFilter proto) { @@ -729,7 +788,7 @@ public SimpleFilter clone() { } @InternalExtensionOnly - public interface Filter extends Cloneable { + public interface Filter extends Cloneable, Serializable { @InternalApi RowFilter toProto(); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java index ad79025258..e5fcd133f5 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java @@ -17,6 +17,8 @@ import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assert.fail; import com.google.bigtable.v2.ColumnRange; import com.google.bigtable.v2.RowFilter; @@ -26,6 +28,15 @@ import com.google.bigtable.v2.TimestampRange; import com.google.bigtable.v2.ValueRange; import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -528,4 +539,213 @@ public void labelTest() { assertThat(actualFilter).isEqualTo(expectedFilter); } + + @Test + public void serializationTest() throws InvocationTargetException, IllegalAccessException { + // checks that the all objects returned by the all methods of the Filters class + // can be serialized/deserialized. + + for (Method m : Filters.class.getDeclaredMethods()) { + String name = m.getName(); + if (Modifier.isPublic(m.getModifiers())) { + switch (name) { + case "condition": + checkSerialization( + name, + FILTERS + .condition( + FILTERS + .chain() + .filter(FILTERS.qualifier().exactMatch("data_plan_10gb")) + .filter(FILTERS.value().exactMatch("true"))) + .then(FILTERS.label("passed-filter")) + .otherwise(FILTERS.label("filtered-out"))); + break; + case "label": + checkSerialization(name, FILTERS.label("label")); + break; + case "fromProto": + checkSerialization(name, FILTERS.label("label").toProto()); + break; + default: + checkSerialization(name, m.invoke(FILTERS)); + } + } + } + } + + private static void checkSerialization(String name, Object filter) { + try { + Object deserialized = serializeDeserialize(filter); + checkClassDeclaresSerialVersionUid(filter.getClass()); + if (filter instanceof Filters.Filter) { + checkFilters(name, (Filters.Filter) filter, (Filters.Filter) deserialized); + } else if (filter instanceof RowFilter) { + assertWithMessage("'" + name + "' deserialized filter differs") + .that(filter) + .isEqualTo(deserialized); + } else { + Class cls = filter.getClass(); + checkClassDoesNotContainNonStaticFields(cls, cls.getFields()); + checkClassDoesNotContainNonStaticFields(cls, cls.getDeclaredFields()); + checkSpawnedFilters(name, cls, filter, deserialized); + } + } catch (IOException | ClassNotFoundException e) { + fail(name + ": " + e); + } + } + + private static void checkFilters( + String name, Filters.Filter original, Filters.Filter deserialized) { + RowFilter protoBefore = ((Filters.Filter) original).toProto(); + RowFilter protoAfter = ((Filters.Filter) deserialized).toProto(); + assertWithMessage("'" + name + "' filter protoBuf mismatches after deserialization") + .that(protoBefore) + .isEqualTo(protoAfter); + } + + private static void checkSpawnedFilters( + String name, Class cls, Object original, Object deserialized) { + + int numberOfMethods = 0; + for (Method m : cls.getDeclaredMethods()) { + if (Modifier.isPublic(m.getModifiers())) { + numberOfMethods++; + } + } + ByteString re = ByteString.copyFromUtf8("some\\[0\\-9\\]regex"); + + switch (name) { + case "family": + { + Filters.FamilyFilter f1 = (Filters.FamilyFilter) original; + Filters.FamilyFilter f2 = (Filters.FamilyFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(2); + checkFilters(name + "/exactMatch", f1.exactMatch("abc"), f2.exactMatch("abc")); + checkFilters(name + "/regex", f1.regex("*"), f2.regex("*")); + + break; + } + case "qualifier": + { + Filters.QualifierFilter f1 = (Filters.QualifierFilter) original; + Filters.QualifierFilter f2 = (Filters.QualifierFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(5); + checkFilters(name + "/exactMatch", f1.exactMatch("abc"), f2.exactMatch("abc")); + checkFilters(name + "/exactMatch(ByteString)", f1.exactMatch(re), f2.exactMatch(re)); + checkFilters(name + "/regex", f1.regex("*"), f2.regex("*")); + checkFilters(name + "/regex(ByteString)", f1.regex(re), f2.regex(re)); + checkFilters( + name + "/rangeWithinFamily", + f1.rangeWithinFamily("family"), + f2.rangeWithinFamily("family")); + + break; + } + case "limit": + { + Filters.LimitFilter f1 = (Filters.LimitFilter) original; + Filters.LimitFilter f2 = (Filters.LimitFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(2); + checkFilters( + name + "/cellsPerColumn", f1.cellsPerColumn(100500), f2.cellsPerColumn(100500)); + checkFilters(name + "/cellsPerRow", f1.cellsPerRow(-10), f2.cellsPerRow(-10)); + + break; + } + case "value": + { + Filters.ValueFilter f1 = (Filters.ValueFilter) original; + Filters.ValueFilter f2 = (Filters.ValueFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(6); + checkFilters(name + "/exactMatch", f1.exactMatch("x"), f2.exactMatch("x")); + checkFilters(name + "/exactMatch(ByteString)", f1.exactMatch(re), f2.exactMatch(re)); + checkFilters(name + "/range", f1.range(), f2.range()); + checkFilters(name + "/regex", f1.regex("*"), f2.regex("*")); + checkFilters(name + "/regex(ByteString)", f1.regex(re), f2.regex(re)); + checkFilters(name + "/strip", f1.strip(), f2.strip()); + + break; + } + case "offset": + { + Filters.OffsetFilter f1 = (Filters.OffsetFilter) original; + Filters.OffsetFilter f2 = (Filters.OffsetFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(1); + checkFilters(name + "/cellsPerRow", f1.cellsPerRow(100500), f2.cellsPerRow(100500)); + + break; + } + case "key": + { + Filters.KeyFilter f1 = (Filters.KeyFilter) original; + Filters.KeyFilter f2 = (Filters.KeyFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(5); + checkFilters(name + "/exactMatch", f1.exactMatch("a"), f2.exactMatch("a")); + checkFilters(name + "/exactMatch(ByteString)", f1.exactMatch(re), f2.exactMatch(re)); + checkFilters(name + "/regex", f1.regex("a"), f2.regex("a")); + checkFilters(name + "/regex(ByteString)", f1.regex(re), f2.regex(re)); + checkFilters(name + "/sample", f1.sample(0.1), f2.sample(0.1)); + + break; + } + case "timestamp": + { + Filters.TimestampFilter f1 = (Filters.TimestampFilter) original; + Filters.TimestampFilter f2 = (Filters.TimestampFilter) deserialized; + + assertThat(numberOfMethods).isEqualTo(2); + checkFilters(name + "/exact", f1.exact(100500L), f2.exact(100500L)); + checkFilters(name + "/range", f1.range(), f2.range()); + + break; + } + default: + fail("Untested filter: " + name); + } + } + + private static void checkClassDeclaresSerialVersionUid(Class cls) { + String uid = "serialVersionUID"; + for (Field field : cls.getDeclaredFields()) { + if (field.getName() == uid) { + int modifiers = field.getModifiers(); + assertWithMessage(field + " is not static").that(Modifier.isStatic(modifiers)).isTrue(); + assertWithMessage(field + " is not final").that(Modifier.isFinal(modifiers)).isTrue(); + assertWithMessage(field + " is not private").that(Modifier.isPrivate(modifiers)).isTrue(); + assertWithMessage(field + " must be long") + .that(field.getType().getSimpleName()) + .isEqualTo("long"); + return; + } + } + fail(cls + " does not declare serialVersionUID"); + } + + private static void checkClassDoesNotContainNonStaticFields(Class cls, Field[] fields) { + for (Field field : fields) { + assertWithMessage(cls + " has a non-static field '" + field + "'") + .that(Modifier.isStatic(field.getModifiers())) + .isTrue(); + } + } + + private static Object serializeDeserialize(Object obj) + throws IOException, ClassNotFoundException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try (ObjectOutputStream outStream = new ObjectOutputStream(bos)) { + outStream.writeObject(obj); + } + + ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); + try (ObjectInputStream inStream = new ObjectInputStream(bis)) { + return inStream.readObject(); + } + } } From 7b3713a8935b2f0b1ca57d189e9e0363506b28a1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 22 Sep 2020 22:07:20 +0200 Subject: [PATCH 10/30] deps: update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.12 (#415) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f2ba7a34a1..60d85d9fe6 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ com.google.cloud google-cloud-conformance-tests - 0.0.11 + 0.0.12 If you want to rebase/retry this PR, check this box --- 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-bigtable). --- google-cloud-bigtable-deps-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index 70327e6032..eb97c3a29d 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-shared-dependencies - 0.9.1 + 0.10.0 pom import From eecce8cf5be8715ce4e73fa1b047440f79d89bb0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 23 Sep 2020 16:00:14 -0700 Subject: [PATCH 13/30] build(java): use yoshi-approver token for auto-approve (#430) Source-Author: Jeff Ching Source-Date: Wed Sep 23 12:46:45 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 916c10e8581804df2b48a0f0457d848f3faa582e Source-Link: https://github.com/googleapis/synthtool/commit/916c10e8581804df2b48a0f0457d848f3faa582e --- .github/workflows/auto-release.yaml | 4 ++-- synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index d26427e468..c849491055 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/github-script@v3.0.0 with: - github-token: ${{secrets.GITHUB_TOKEN}} + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true script: | // only approve PRs from release-please[bot] @@ -66,4 +66,4 @@ jobs: repo: context.repo.repo, issue_number: context.payload.pull_request.number, labels: ['kokoro:force-run', 'automerge'] - }); \ No newline at end of file + }); diff --git a/synth.metadata b/synth.metadata index 375100f554..4a016f38fd 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "ad63449259d1858b8c2e63856bf4d5487cbea153" + "sha": "373032e93b838cbc0ccab7dc45cd61b3b973542a" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "80003a3de2d8a75f5b47cb2e77e018f7f0f776cc" + "sha": "916c10e8581804df2b48a0f0457d848f3faa582e" } } ], From fe71a51d83d2b734bcaf88a83a3c44d86f407af6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 24 Sep 2020 19:46:20 +0200 Subject: [PATCH 14/30] chore(deps): update dependency com.google.cloud:libraries-bom to v11 (#431) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `10.1.0` -> `11.0.0` | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- 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-bigtable). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5f0438b486..e896c9f265 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 10.1.0 + 11.0.0 pom import From 75749153c181892fb53b1b1e255928f1cc77674a Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 24 Sep 2020 14:00:35 -0700 Subject: [PATCH 15/30] chore: add repo settings configuration (#429) --- .github/sync-repo-settings.yaml | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/sync-repo-settings.yaml diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml new file mode 100644 index 0000000000..6bddd18eac --- /dev/null +++ b/.github/sync-repo-settings.yaml @@ -0,0 +1,49 @@ + +# Whether or not rebase-merging is enabled on this repository. +# Defaults to `true` +rebaseMergeAllowed: false + +# Whether or not squash-merging is enabled on this repository. +# Defaults to `true` +squashMergeAllowed: true + +# Whether or not PRs are merged with a merge commit on this repository. +# Defaults to `false` +mergeCommitAllowed: false + +# Rules for master branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `master` +- pattern: master + # Can admins overwrite branch protection. + # Defaults to `true` + isAdminEnforced: true + # Number of approving reviews required to update matching branches. + # Defaults to `1` + requiredApprovingReviewCount: 1 + # Are reviews from code owners required to update matching branches. + # Defaults to `false` + requiresCodeOwnerReviews: true + # Require up to date branches + requiresStrictStatusChecks: false + # List of required status check contexts that must pass for commits to be accepted to matching branches. + requiredStatusCheckContexts: + - "dependencies (8)" + - "dependencies (11)" + - "linkage-monitor" + - "lint" + - "clirr" + - "units (7)" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" +# List of explicit permissions to add (additive only) +permissionRules: +- team: yoshi-admins + permission: admin +- team: yoshi-java-admins + permission: admin +- team: yoshi-java + permission: push \ No newline at end of file From a84b155f042a25860b2e164e7704f688cd684304 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 25 Sep 2020 07:23:02 -0700 Subject: [PATCH 16/30] chore(ci): skip autorelease workflow on non-release PRs (#433) Source-Author: Stephanie Wang Source-Date: Thu Sep 24 16:57:32 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 95dbe1bee3c7f7e52ddb24a54c37080620e0d1a2 Source-Link: https://github.com/googleapis/synthtool/commit/95dbe1bee3c7f7e52ddb24a54c37080620e0d1a2 --- .github/workflows/auto-release.yaml | 1 + synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index c849491055..3ce51eeea7 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -4,6 +4,7 @@ name: auto-release jobs: approve: runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-v') steps: - uses: actions/github-script@v3.0.0 with: diff --git a/synth.metadata b/synth.metadata index 4a016f38fd..ef106593cd 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "373032e93b838cbc0ccab7dc45cd61b3b973542a" + "sha": "75749153c181892fb53b1b1e255928f1cc77674a" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "916c10e8581804df2b48a0f0457d848f3faa582e" + "sha": "95dbe1bee3c7f7e52ddb24a54c37080620e0d1a2" } } ], From f9c9acb9a81962c83657619237468b21fc4c570f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 25 Sep 2020 16:23:29 +0200 Subject: [PATCH 17/30] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.19 (#432) --- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 486fc339d9..af584353c1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.18 + 1.0.19 diff --git a/samples/pom.xml b/samples/pom.xml index ac04bb8af3..008a218593 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -18,7 +18,7 @@ com.google.cloud.samples shared-configuration - 1.0.18 + 1.0.19 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b3c552cd57..b124f8755a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.18 + 1.0.19 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e896c9f265..0a471e6777 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.18 + 1.0.19 From 2ab94c15c285e0b68704c8d12e274bc026a5e8ed Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 25 Sep 2020 20:22:04 +0200 Subject: [PATCH 18/30] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.20 (#434) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud.samples:shared-configuration](com/google/cloud/samples/shared-configuration) | patch | `1.0.19` -> `1.0.20` | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- 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-bigtable). --- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index af584353c1..25761d5f3b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.19 + 1.0.20 diff --git a/samples/pom.xml b/samples/pom.xml index 008a218593..c3c20bcc4e 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -18,7 +18,7 @@ com.google.cloud.samples shared-configuration - 1.0.19 + 1.0.20 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b124f8755a..72a766895b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.19 + 1.0.20 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0a471e6777..e0ecf06886 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.19 + 1.0.20 From da3ee019597e4aa119877063c1dc2fe9e2da0bed Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 25 Sep 2020 15:08:24 -0700 Subject: [PATCH 19/30] chore(ci): verify autorelease release PR content has changes (#435) Source-Author: Stephanie Wang Source-Date: Thu Sep 24 18:06:14 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: da29da32b3a988457b49ae290112b74f14b713cc Source-Link: https://github.com/googleapis/synthtool/commit/da29da32b3a988457b49ae290112b74f14b713cc --- .github/workflows/auto-release.yaml | 18 ++++++++++++++++++ synth.metadata | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 3ce51eeea7..bc1554aecb 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -21,6 +21,24 @@ jobs: return; } + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + // trigger auto-release when // 1) it is a SNAPSHOT release (auto-generated post regular release) // 2) there are dependency updates only diff --git a/synth.metadata b/synth.metadata index ef106593cd..d4ff325868 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "75749153c181892fb53b1b1e255928f1cc77674a" + "sha": "2ab94c15c285e0b68704c8d12e274bc026a5e8ed" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "95dbe1bee3c7f7e52ddb24a54c37080620e0d1a2" + "sha": "da29da32b3a988457b49ae290112b74f14b713cc" } } ], From 035017808d633c9dbae712bcea90df00b1287023 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 30 Sep 2020 09:12:07 -0700 Subject: [PATCH 20/30] chore(java): use separate autosynth job for README (#436) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/0569c16d-a278-4261-99a5-cc4794f30ebd/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/e6168630be3e31eede633ba2c6f1cd64248dec1c --- .github/readme/synth.py | 19 ++++++++++++ .kokoro/continuous/readme.cfg | 55 +++++++++++++++++++++++++++++++++++ .kokoro/readme.sh | 36 +++++++++++++++++++++++ synth.metadata | 7 +++-- 4 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 .github/readme/synth.py create mode 100644 .kokoro/continuous/readme.cfg create mode 100644 .kokoro/readme.sh diff --git a/.github/readme/synth.py b/.github/readme/synth.py new file mode 100644 index 0000000000..7b48cc28d3 --- /dev/null +++ b/.github/readme/synth.py @@ -0,0 +1,19 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) diff --git a/.kokoro/continuous/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 0000000000..5b59996afa --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-bigtable/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh new file mode 100644 index 0000000000..b586093890 --- /dev/null +++ b/.kokoro/readme.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-bigtable + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Kokoro exposes this as a file, but the scripts expect just a plain variable. +export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) + +# Setup git credentials +echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials +git config --global credential.helper 'store --file ~/.git-credentials' + +python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool +python3.6 -m autosynth.synth \ + --repository=googleapis/java-bigtable \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" \ No newline at end of file diff --git a/synth.metadata b/synth.metadata index d4ff325868..fce0ef0d4b 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "2ab94c15c285e0b68704c8d12e274bc026a5e8ed" + "sha": "da3ee019597e4aa119877063c1dc2fe9e2da0bed" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "da29da32b3a988457b49ae290112b74f14b713cc" + "sha": "e6168630be3e31eede633ba2c6f1cd64248dec1c" } } ], @@ -48,6 +48,7 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", + ".github/readme/synth.py", ".github/release-please.yml", ".github/trusted-contribution.yml", ".github/workflows/auto-release.yaml", @@ -60,6 +61,7 @@ ".kokoro/common.sh", ".kokoro/continuous/common.cfg", ".kokoro/continuous/java8.cfg", + ".kokoro/continuous/readme.cfg", ".kokoro/dependencies.sh", ".kokoro/linkage-monitor.sh", ".kokoro/nightly/common.cfg", @@ -79,6 +81,7 @@ ".kokoro/presubmit/java8.cfg", ".kokoro/presubmit/linkage-monitor.cfg", ".kokoro/presubmit/lint.cfg", + ".kokoro/readme.sh", ".kokoro/release/bump_snapshot.cfg", ".kokoro/release/common.cfg", ".kokoro/release/common.sh", From 000987fa784809a4f269203e604b9184099ca8ce Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 30 Sep 2020 20:18:06 +0200 Subject: [PATCH 21/30] chore(deps): update dependency com.google.cloud:libraries-bom to v11.1.0 (#437) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | minor | `11.0.0` -> `11.1.0` | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- 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-bigtable). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e0ecf06886..4a5fbd105b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 11.0.0 + 11.1.0 pom import From fb7bc5c06078ce277a85ec77e0249297b97750ea Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 30 Sep 2020 16:54:13 -0700 Subject: [PATCH 22/30] build: rename samples lint workflow to checkstyle to disambiguate branch protection with unit lint (#438) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ba5c03b5-9f6c-4870-91e7-22fd13b7363f/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/8a7a3021fe97aa0a3641db642fe2b767f1c8110f --- .github/workflows/samples.yaml | 2 +- synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index a1d5007306..c46230a78c 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -2,7 +2,7 @@ on: pull_request: name: samples jobs: - lint: + checkstyle: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/synth.metadata b/synth.metadata index fce0ef0d4b..62814f52a7 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "da3ee019597e4aa119877063c1dc2fe9e2da0bed" + "sha": "000987fa784809a4f269203e604b9184099ca8ce" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e6168630be3e31eede633ba2c6f1cd64248dec1c" + "sha": "8a7a3021fe97aa0a3641db642fe2b767f1c8110f" } } ], From c5c881bb956860a393c2a7f34d0d790a23d270af Mon Sep 17 00:00:00 2001 From: Igor Bernstein Date: Thu, 1 Oct 2020 14:33:24 -0400 Subject: [PATCH 23/30] fix(test): Clean up tests (#439) * fix(test): Clean up tests * Add missing RunWith annotations * unnecessary downcasts * Make emulator path overridable * add missing annotation * lint --- .../google/cloud/bigtable/emulator/v2/Emulator.java | 4 +++- .../admin/v2/BigtableInstanceAdminSettingsTest.java | 3 +++ .../admin/v2/BigtableTableAdminClientTest.java | 8 ++++++-- .../admin/v2/BigtableTableAdminSettingsTest.java | 3 +++ .../cloud/bigtable/admin/v2/it/BigtableBackupIT.java | 3 +++ .../admin/v2/it/BigtableInstanceAdminClientIT.java | 3 +++ .../admin/v2/it/BigtableTableAdminClientIT.java | 3 +++ .../data/v2/models/ReadModifyWriteRowTest.java | 3 +++ .../data/v2/stub/EnhancedBigtableStubTest.java | 6 +++--- .../cloud/bigtable/test_helpers/env/EmulatorEnv.java | 11 ++++++++++- 10 files changed, 40 insertions(+), 7 deletions(-) diff --git a/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java b/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java index 9c2fa49b38..8e8cd5ad0d 100644 --- a/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java +++ b/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java @@ -42,7 +42,6 @@ */ @BetaApi("Surface for Bigtable emulator is not yet stable") public class Emulator { - private static final Logger LOGGER = Logger.getLogger(Emulator.class.getName()); private final Path executable; @@ -54,6 +53,9 @@ public class Emulator { private ManagedChannel dataChannel; private ManagedChannel adminChannel; + public static Emulator createFromPath(Path path) { + return new Emulator(path); + } /** * Create a new instance of emulator. The emulator will use the bundled binaries in this jar. * Please note that the emulator is created in a stopped state, please use {@link #start()} after diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java index 6fa6f3e4a7..c6ccf9557b 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java @@ -21,8 +21,11 @@ import com.google.api.gax.rpc.StatusCode.Code; import java.io.IOException; import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.mockito.Mockito; +@RunWith(JUnit4.class) public class BigtableInstanceAdminSettingsTest { @Test public void testProjectName() throws Exception { diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java index 2cda42b3ea..c265514325 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java @@ -71,18 +71,22 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; import org.mockito.stubbing.Answer; import org.threeten.bp.Instant; -@RunWith(MockitoJUnitRunner.class) +@RunWith(JUnit4.class) public class BigtableTableAdminClientTest { + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); private static final String PROJECT_ID = "my-project"; private static final String INSTANCE_ID = "my-instance"; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java index 3a16dd236d..77ce733ce0 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java @@ -21,8 +21,11 @@ import com.google.api.gax.rpc.StatusCode.Code; import java.io.IOException; import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.mockito.Mockito; +@RunWith(JUnit4.class) public class BigtableTableAdminSettingsTest { @Test diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java index 1e1bc84648..4d17bbf0e9 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java @@ -47,9 +47,12 @@ import java.util.concurrent.TimeoutException; import java.util.logging.Logger; import org.junit.*; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.threeten.bp.Duration; import org.threeten.bp.Instant; +@RunWith(JUnit4.class) public class BigtableBackupIT { private static final Logger LOGGER = Logger.getLogger(BigtableBackupIT.class.getName()); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java index f31654334d..9b41444c7f 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java @@ -40,8 +40,11 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.threeten.bp.Instant; +@RunWith(JUnit4.class) public class BigtableInstanceAdminClientIT { @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java index 333fa875ce..2dc64b6407 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java @@ -46,8 +46,11 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; import org.threeten.bp.Duration; +@RunWith(JUnit4.class) public class BigtableTableAdminClientIT { @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); @Rule public final TestName testNameRule = new TestName(); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java index b9e6f9e7ba..b0a8be33c9 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java @@ -28,7 +28,10 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +@RunWith(JUnit4.class) public class ReadModifyWriteRowTest { private static final String PROJECT_ID = "fake-project"; private static final String INSTANCE_ID = "fake-instance"; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java index b823930fb6..6d0ba10bf6 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java @@ -138,11 +138,11 @@ public void testChannelPrimerConfigured() throws IOException { } private static class FakeDataService extends BigtableGrpc.BigtableImplBase { - final BlockingQueue requests = Queues.newLinkedBlockingDeque(); + final BlockingQueue requests = Queues.newLinkedBlockingDeque(); @SuppressWarnings("unchecked") - T popLastRequest() throws InterruptedException { - return (T) requests.poll(1, TimeUnit.SECONDS); + ReadRowsRequest popLastRequest() throws InterruptedException { + return requests.poll(1, TimeUnit.SECONDS); } @Override diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java index f3e97584e3..d1740fbfcd 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java @@ -22,8 +22,12 @@ import com.google.cloud.bigtable.data.v2.BigtableDataClient; import com.google.cloud.bigtable.data.v2.BigtableDataSettings; import com.google.cloud.bigtable.emulator.v2.Emulator; +import com.google.common.base.Strings; +import java.nio.file.Paths; public class EmulatorEnv extends AbstractTestEnv { + private static final String EMULATOR_OVERRIDE_PROPERTY_NAME = "bigtable.emulator-path"; + private static final String PROJECT_ID = "fake-project"; private static final String INSTANCE_ID = "fake-instance"; private static final String TABLE_ID = "default-table"; @@ -42,7 +46,12 @@ private EmulatorEnv() {} @Override void start() throws Exception { - emulator = Emulator.createBundled(); + String overridePath = System.getProperty(EMULATOR_OVERRIDE_PROPERTY_NAME); + if (!Strings.isNullOrEmpty(overridePath)) { + emulator = Emulator.createFromPath(Paths.get(overridePath)); + } else { + emulator = Emulator.createBundled(); + } emulator.start(); dataSettings = From f1d9d0db2cec7c096a421262ec9a968179debbe0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 2 Oct 2020 16:12:53 +0200 Subject: [PATCH 24/30] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.21 (#440) --- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 25761d5f3b..d6bd01bd61 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.20 + 1.0.21 diff --git a/samples/pom.xml b/samples/pom.xml index c3c20bcc4e..1e76b96358 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -18,7 +18,7 @@ com.google.cloud.samples shared-configuration - 1.0.20 + 1.0.21 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 72a766895b..9764fcfc11 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.20 + 1.0.21 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4a5fbd105b..2349fe342a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.20 + 1.0.21 From 9e693b45847bfe74eafa09362e3d12fadc62b7f5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Oct 2020 16:26:36 +0200 Subject: [PATCH 25/30] chore(deps): update dependency com.google.cloud:libraries-bom to v12 (#441) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2349fe342a..dcfbdd8db0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 11.1.0 + 12.0.0 pom import From 939fefa819d09885489d9faeedadc74ee2b0e1b9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Oct 2020 21:52:37 +0200 Subject: [PATCH 26/30] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.1 (#443) --- google-cloud-bigtable-deps-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index eb97c3a29d..75a9ca25c8 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-shared-dependencies - 0.10.0 + 0.10.1 pom import From 0cd71b59305cd7a336c223faff68402a8bee4639 Mon Sep 17 00:00:00 2001 From: Igor Bernstein Date: Tue, 6 Oct 2020 16:02:28 -0400 Subject: [PATCH 27/30] feat: include User agent (#404) * feat: populate UserAgent in addition to x-goog-api-client * add a comment --- .../v2/stub/EnhancedBigtableStubSettings.java | 19 ++++++++- .../v2/stub/EnhancedBigtableStubTest.java | 40 ++++++++++++++++++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index d843265d1e..0bc3b5acc9 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -20,9 +20,11 @@ import com.google.api.gax.batching.BatchingSettings; import com.google.api.gax.batching.FlowControlSettings; import com.google.api.gax.batching.FlowController.LimitExceededBehavior; +import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.FixedHeaderProvider; import com.google.api.gax.rpc.ServerStreamingCallSettings; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.StubSettings; @@ -38,8 +40,10 @@ import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.logging.Logger; import javax.annotation.Nonnull; @@ -530,8 +534,19 @@ private Builder() { setTransportChannelProvider(defaultTransportChannelProvider()); setStreamWatchdogCheckInterval(baseDefaults.getStreamWatchdogCheckInterval()); setStreamWatchdogProvider(baseDefaults.getStreamWatchdogProvider()); - setInternalHeaderProvider( - BigtableStubSettings.defaultApiClientHeaderProviderBuilder().build()); + + // Inject the UserAgent in addition to api-client header + Map headers = + ImmutableMap.builder() + .putAll( + BigtableStubSettings.defaultApiClientHeaderProviderBuilder().build().getHeaders()) + // GrpcHeaderInterceptor treats the `user-agent` as a magic string + .put( + "user-agent", + "bigtable-java/" + + GaxProperties.getLibraryVersion(EnhancedBigtableStubSettings.class)) + .build(); + setInternalHeaderProvider(FixedHeaderProvider.create(headers)); // Per-method settings using baseSettings for defaults. readRowsSettings = ServerStreamingCallSettings.newBuilder(); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java index 6d0ba10bf6..b9c5c96167 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java @@ -33,8 +33,13 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; +import io.grpc.Metadata; import io.grpc.Server; import io.grpc.ServerBuilder; +import io.grpc.ServerCall; +import io.grpc.ServerCall.Listener; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; import io.grpc.stub.StreamObserver; import java.io.IOException; import java.net.ServerSocket; @@ -56,6 +61,7 @@ public class EnhancedBigtableStubTest { private static final String APP_PROFILE_ID = "app-profile-id"; private Server server; + private MetadataInterceptor metadataInterceptor; private FakeDataService fakeDataService; private EnhancedBigtableStubSettings defaultSettings; private EnhancedBigtableStub enhancedBigtableStub; @@ -66,8 +72,13 @@ public void setUp() throws IOException, IllegalAccessException, InstantiationExc try (ServerSocket ss = new ServerSocket(0)) { port = ss.getLocalPort(); } + metadataInterceptor = new MetadataInterceptor(); fakeDataService = new FakeDataService(); - server = ServerBuilder.forPort(port).addService(fakeDataService).build(); + server = + ServerBuilder.forPort(port) + .intercept(metadataInterceptor) + .addService(fakeDataService) + .build(); server.start(); defaultSettings = @@ -137,6 +148,33 @@ public void testChannelPrimerConfigured() throws IOException { } } + @Test + public void testUserAgent() throws InterruptedException { + ServerStreamingCallable streamingCallable = + enhancedBigtableStub.createReadRowsCallable(new DefaultRowAdapter()); + + Query request = Query.create("table-id").rowKey("row-key"); + streamingCallable.call(request).iterator().next(); + + assertThat(metadataInterceptor.headers).hasSize(1); + Metadata metadata = metadataInterceptor.headers.take(); + assertThat(metadata.get(Metadata.Key.of("user-agent", Metadata.ASCII_STRING_MARSHALLER))) + .contains("bigtable-java/"); + } + + private static class MetadataInterceptor implements ServerInterceptor { + final BlockingQueue headers = Queues.newLinkedBlockingDeque(); + + @Override + public Listener interceptCall( + ServerCall serverCall, + Metadata metadata, + ServerCallHandler serverCallHandler) { + headers.add(metadata); + return serverCallHandler.startCall(serverCall, metadata); + } + } + private static class FakeDataService extends BigtableGrpc.BigtableImplBase { final BlockingQueue requests = Queues.newLinkedBlockingDeque(); From 25eafddcb5c0e526a9a2e89d5c062ed73305b8e4 Mon Sep 17 00:00:00 2001 From: ZHANG Dapeng Date: Tue, 6 Oct 2020 13:03:28 -0700 Subject: [PATCH 28/30] cleanup: update direct path endpoint (#414) --- .../bigtable/data/v2/stub/EnhancedBigtableStubSettings.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index 0bc3b5acc9..5253a5a1b8 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -86,8 +86,7 @@ public class EnhancedBigtableStubSettings extends StubSettings IDEMPOTENT_RETRY_CODES = ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); From edbcde1a5b22317319803cb57401252aac6d580d Mon Sep 17 00:00:00 2001 From: Sushan Bhattarai Date: Tue, 6 Oct 2020 14:09:53 -0600 Subject: [PATCH 29/30] feat: add keepalive changes in java client library (#409) * feat: Add keepalive logic in bigtable data client * fix: code formatting * fix: mvn formatting * fix: setting in emulator * feat: add keep alive in enhanced stub as well --- .../com/google/cloud/bigtable/emulator/v2/Emulator.java | 8 +++++++- .../cloud/bigtable/data/v2/BigtableDataSettings.java | 5 +++++ .../data/v2/stub/EnhancedBigtableStubSettings.java | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java b/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java index 8e8cd5ad0d..3cfbc981ab 100644 --- a/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java +++ b/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java @@ -179,7 +179,13 @@ public synchronized ManagedChannel getDataChannel() { } if (dataChannel == null) { - dataChannel = newChannelBuilder(port).maxInboundMessageSize(256 * 1024 * 1024).build(); + dataChannel = + newChannelBuilder(port) + .maxInboundMessageSize(256 * 1024 * 1024) + .keepAliveTimeout(10, TimeUnit.SECONDS) + .keepAliveTime(10, TimeUnit.SECONDS) + .keepAliveWithoutCalls(true) + .build(); } return dataChannel; } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java index 8dd0fa6d97..3b07eeaf23 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.logging.Logger; import javax.annotation.Nonnull; +import org.threeten.bp.Duration; /** * Settings class to configure an instance of {@link BigtableDataClient}. @@ -122,6 +123,10 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder input) { return input.usePlaintext(); } }) + .setKeepAliveTime(Duration.ofSeconds(10)) // sends ping in this interval + .setKeepAliveTimeout( + Duration.ofSeconds(10)) // wait this long before considering the connection dead + .setKeepAliveWithoutCalls(true) // sends ping without active streams .build()); LOGGER.info("Connecting to the Bigtable emulator at " + hostname + ":" + port); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index 5253a5a1b8..360141083e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -241,6 +241,10 @@ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProvi return BigtableStubSettings.defaultGrpcTransportProviderBuilder() .setPoolSize(getDefaultChannelPoolSize()) .setMaxInboundMessageSize(MAX_MESSAGE_SIZE) + .setKeepAliveTime(Duration.ofSeconds(10)) // sends ping in this interval + .setKeepAliveTimeout( + Duration.ofSeconds(10)) // wait this long before considering the connection dead + .setKeepAliveWithoutCalls(true) // sends ping without active streams // TODO(weiranf): Set this to true by default once DirectPath goes to public beta .setAttemptDirectPath(isDirectPathEnabled()); } From f33c6746cf067378686c07ac8941b082ad7ba031 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2020 20:26:02 +0000 Subject: [PATCH 30/30] chore: release 1.16.0 (#444) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release \*beep\* \*boop\* --- ## [1.16.0](https://www.github.com/googleapis/java-bigtable/compare/v1.15.0...v1.16.0) (2020-10-06) ### Features * add keepalive changes in java client library ([#409](https://www.github.com/googleapis/java-bigtable/issues/409)) ([edbcde1](https://www.github.com/googleapis/java-bigtable/commit/edbcde1a5b22317319803cb57401252aac6d580d)) * include User agent ([#404](https://www.github.com/googleapis/java-bigtable/issues/404)) ([0cd71b5](https://www.github.com/googleapis/java-bigtable/commit/0cd71b59305cd7a336c223faff68402a8bee4639)) * Ability to extend UserAgent string (via gax upgrade) ### Bug Fixes * **test:** Clean up tests ([#439](https://www.github.com/googleapis/java-bigtable/issues/439)) ([c5c881b](https://www.github.com/googleapis/java-bigtable/commit/c5c881bb956860a393c2a7f34d0d790a23d270af)) * Add documentation to bulkReadRows that each batch will process t… ([#410](https://www.github.com/googleapis/java-bigtable/issues/410)) ([71dc8e3](https://www.github.com/googleapis/java-bigtable/commit/71dc8e3419fbb49d48bb7a3fd984d24e24661c81)) * Filters should be serializable ([#397](https://www.github.com/googleapis/java-bigtable/issues/397)) ([57edfde](https://www.github.com/googleapis/java-bigtable/commit/57edfde5eace28d50ec777e14589c9747616f0a8)) * RowCells are not actually serializeable ([#407](https://www.github.com/googleapis/java-bigtable/issues/407)) ([39e17cc](https://www.github.com/googleapis/java-bigtable/commit/39e17cc17c438f2d665875f9ff2b2cdf984e37b7)) * Fix race condition in Batcher.close() (via gax upgrade) ### Dependencies * update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.12 ([#415](https://www.github.com/googleapis/java-bigtable/issues/415)) ([7b3713a](https://www.github.com/googleapis/java-bigtable/commit/7b3713a8935b2f0b1ca57d189e9e0363506b28a1)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.0 ([#428](https://www.github.com/googleapis/java-bigtable/issues/428)) ([373032e](https://www.github.com/googleapis/java-bigtable/commit/373032e93b838cbc0ccab7dc45cd61b3b973542a)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.1 ([#443](https://www.github.com/googleapis/java-bigtable/issues/443)) ([939fefa](https://www.github.com/googleapis/java-bigtable/commit/939fefa819d09885489d9faeedadc74ee2b0e1b9)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.9.1 ([#427](https://www.github.com/googleapis/java-bigtable/issues/427)) ([5175e28](https://www.github.com/googleapis/java-bigtable/commit/5175e28f5ce69f6fb3ed14131c1cfd26dbc47bb9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- CHANGELOG.md | 24 ++++++++++++++++++++ README.md | 6 ++--- google-cloud-bigtable-bom/pom.xml | 14 ++++++------ google-cloud-bigtable-deps-bom/pom.xml | 2 +- google-cloud-bigtable-emulator/pom.xml | 8 +++---- google-cloud-bigtable/pom.xml | 8 +++---- grpc-google-cloud-bigtable-admin-v2/pom.xml | 8 +++---- grpc-google-cloud-bigtable-v2/pom.xml | 8 +++---- pom.xml | 2 +- proto-google-cloud-bigtable-admin-v2/pom.xml | 8 +++---- proto-google-cloud-bigtable-v2/pom.xml | 8 +++---- samples/snapshot/pom.xml | 2 +- versions.txt | 12 +++++----- 13 files changed, 67 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b5c872aa6..bb8588e785 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [1.16.0](https://www.github.com/googleapis/java-bigtable/compare/v1.15.0...v1.16.0) (2020-10-06) + + +### Features + +* add keepalive changes in java client library ([#409](https://www.github.com/googleapis/java-bigtable/issues/409)) ([edbcde1](https://www.github.com/googleapis/java-bigtable/commit/edbcde1a5b22317319803cb57401252aac6d580d)) +* include User agent ([#404](https://www.github.com/googleapis/java-bigtable/issues/404)) ([0cd71b5](https://www.github.com/googleapis/java-bigtable/commit/0cd71b59305cd7a336c223faff68402a8bee4639)) + + +### Bug Fixes + +* **test:** Clean up tests ([#439](https://www.github.com/googleapis/java-bigtable/issues/439)) ([c5c881b](https://www.github.com/googleapis/java-bigtable/commit/c5c881bb956860a393c2a7f34d0d790a23d270af)) +* Add documentation to bulkReadRows that each batch will process t… ([#410](https://www.github.com/googleapis/java-bigtable/issues/410)) ([71dc8e3](https://www.github.com/googleapis/java-bigtable/commit/71dc8e3419fbb49d48bb7a3fd984d24e24661c81)) +* Filters should be serializable ([#397](https://www.github.com/googleapis/java-bigtable/issues/397)) ([57edfde](https://www.github.com/googleapis/java-bigtable/commit/57edfde5eace28d50ec777e14589c9747616f0a8)) +* RowCells are not actually serializeable ([#407](https://www.github.com/googleapis/java-bigtable/issues/407)) ([39e17cc](https://www.github.com/googleapis/java-bigtable/commit/39e17cc17c438f2d665875f9ff2b2cdf984e37b7)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-conformance-tests to v0.0.12 ([#415](https://www.github.com/googleapis/java-bigtable/issues/415)) ([7b3713a](https://www.github.com/googleapis/java-bigtable/commit/7b3713a8935b2f0b1ca57d189e9e0363506b28a1)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.0 ([#428](https://www.github.com/googleapis/java-bigtable/issues/428)) ([373032e](https://www.github.com/googleapis/java-bigtable/commit/373032e93b838cbc0ccab7dc45cd61b3b973542a)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.1 ([#443](https://www.github.com/googleapis/java-bigtable/issues/443)) ([939fefa](https://www.github.com/googleapis/java-bigtable/commit/939fefa819d09885489d9faeedadc74ee2b0e1b9)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.9.1 ([#427](https://www.github.com/googleapis/java-bigtable/issues/427)) ([5175e28](https://www.github.com/googleapis/java-bigtable/commit/5175e28f5ce69f6fb3ed14131c1cfd26dbc47bb9)) + ## [1.15.0](https://www.github.com/googleapis/java-bigtable/compare/v1.14.0...v1.15.0) (2020-09-01) diff --git a/README.md b/README.md index 90549e0575..22f3636595 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-bigtable - 1.15.0 + 1.16.0 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigtable:1.15.0' +compile 'com.google.cloud:google-cloud-bigtable:1.16.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "1.15.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "1.16.0" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index b37a525fa7..addc96ab77 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 1.15.1-SNAPSHOT + 1.16.0 pom com.google.cloud @@ -72,32 +72,32 @@ com.google.cloud google-cloud-bigtable - 1.15.1-SNAPSHOT + 1.16.0 com.google.cloud google-cloud-bigtable-emulator - 0.124.1-SNAPSHOT + 0.125.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 1.15.1-SNAPSHOT + 1.16.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 1.15.1-SNAPSHOT + 1.16.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 1.15.1-SNAPSHOT + 1.16.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 1.15.1-SNAPSHOT + 1.16.0 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index 75a9ca25c8..fee20379f6 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -12,7 +12,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.1-SNAPSHOT + 1.16.0 pom diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index 4a39dea576..166d242889 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.124.1-SNAPSHOT + 0.125.0 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 1.15.1-SNAPSHOT + 1.16.0 scm:git:git@github.com:googleapis/java-bigtable.git @@ -80,14 +80,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index c72d32e424..d967fe0e00 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 1.15.1-SNAPSHOT + 1.16.0 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,7 +12,7 @@ com.google.cloud google-cloud-bigtable-parent - 1.15.1-SNAPSHOT + 1.16.0 google-cloud-bigtable @@ -36,14 +36,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index b2a550d88d..eff3d8ce9a 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 1.15.1-SNAPSHOT + 1.16.0 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 1.15.1-SNAPSHOT + 1.16.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index 32a03eb71e..1be1cf84e9 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 1.15.1-SNAPSHOT + 1.16.0 grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 1.15.1-SNAPSHOT + 1.16.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import diff --git a/pom.xml b/pom.xml index 60d85d9fe6..b2fecd978b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 1.15.1-SNAPSHOT + 1.16.0 Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index d4d6d31c5a..0bdf97122f 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 1.15.1-SNAPSHOT + 1.16.0 proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 1.15.1-SNAPSHOT + 1.16.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index a157e532c8..4c3c3371b6 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 1.15.1-SNAPSHOT + 1.16.0 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 1.15.1-SNAPSHOT + 1.16.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.15.1-SNAPSHOT + 1.16.0 pom import diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9764fcfc11..dc81eb9d44 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 1.15.1-SNAPSHOT + 1.16.0 diff --git a/versions.txt b/versions.txt index d5c69efbd8..6cbd7fef61 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:1.15.0:1.15.1-SNAPSHOT -grpc-google-cloud-bigtable-admin-v2:1.15.0:1.15.1-SNAPSHOT -grpc-google-cloud-bigtable-v2:1.15.0:1.15.1-SNAPSHOT -proto-google-cloud-bigtable-admin-v2:1.15.0:1.15.1-SNAPSHOT -proto-google-cloud-bigtable-v2:1.15.0:1.15.1-SNAPSHOT -google-cloud-bigtable-emulator:0.124.0:0.124.1-SNAPSHOT +google-cloud-bigtable:1.16.0:1.16.0 +grpc-google-cloud-bigtable-admin-v2:1.16.0:1.16.0 +grpc-google-cloud-bigtable-v2:1.16.0:1.16.0 +proto-google-cloud-bigtable-admin-v2:1.16.0:1.16.0 +proto-google-cloud-bigtable-v2:1.16.0:1.16.0 +google-cloud-bigtable-emulator:0.125.0:0.125.0