diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9786771c43..3473042c08 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:3c950ed12391ebaffd1ee66d0374766a1c50144ebe6a7a0042300b2e6bb5856b + digest: sha256:df8d7b2cc0dbc65871e7edd86601901a0612b272fa3f7f0eb590c5c53aa5f92e diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4238681315..80e82f54fa 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,3 +5,6 @@ Thank you for opening a Pull Request! Before submitting your PR, there are a few - [ ] Appropriate docs were updated (if necessary) Fixes # ☕️ + +If you write sample code, please follow the [samples format]( +https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index 1bb1823276..f5fc7d5169 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 18e23230d9..7a106d007e 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: contains(github.head_ref, 'release-please') steps: - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6b5e56aaac..83ef7f9c2c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,8 +27,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: ${{matrix.java}} @@ -39,8 +39,8 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 @@ -54,8 +54,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: ${{matrix.java}} @@ -64,8 +64,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 11 @@ -76,8 +76,8 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index d5d964df15..912ed8b2b0 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -20,9 +20,10 @@ jobs: checkstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: + distribution: zulu java-version: 8 - name: Run checkstyle run: mvn -P lint --quiet --batch-mode checkstyle:check diff --git a/.kokoro/build.bat b/.kokoro/build.bat index cc602c9eba..067cf4a4c4 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,18 +1,18 @@ +:: Copyright 2022 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. +:: Github action job to test core java library features on +:: downstream client libraries before they are released. :: See documentation in type-shell-output.bat -# Copyright 2022 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. -# Github action job to test core java library features on -# downstream client libraries before they are released. "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 965f672ea2..2b5fa2e1ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [2.6.0](https://github.com/googleapis/java-bigtable/compare/v2.5.3...v2.6.0) (2022-03-03) + + +### Features + +* add WarmAndPing request for channel priming ([#1178](https://github.com/googleapis/java-bigtable/issues/1178)) ([385ab33](https://github.com/googleapis/java-bigtable/commit/385ab33d12479a9d2b1b66babef9b9b5846b902a)) + + +### Documentation + +* **sample:** Add sample for native image support in Bigtable ([#1165](https://github.com/googleapis/java-bigtable/issues/1165)) ([143aaee](https://github.com/googleapis/java-bigtable/commit/143aaee42e1b59d125250982dbeb34a31d906e30)) + + +### Dependencies + +* update actions/github-script action to v6 ([#1170](https://github.com/googleapis/java-bigtable/issues/1170)) ([5790bdf](https://github.com/googleapis/java-bigtable/commit/5790bdf875d27e6194f1753ff66d208f65488716)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#1186](https://github.com/googleapis/java-bigtable/issues/1186)) ([74cafca](https://github.com/googleapis/java-bigtable/commit/74cafcae4a562b87f1664b8844794a2e68c97625)) +* update dependency com.google.cloud:native-image-support to v0.12.4 ([#1175](https://github.com/googleapis/java-bigtable/issues/1175)) ([9cc6fbc](https://github.com/googleapis/java-bigtable/commit/9cc6fbc7de22303e17492824971fcc52fb041254)) +* update dependency com.google.cloud:native-image-support to v0.12.5 ([#1183](https://github.com/googleapis/java-bigtable/issues/1183)) ([b025b34](https://github.com/googleapis/java-bigtable/commit/b025b343af0b9309558f530dc0765bf2b4c4d588)) +* update dependency com.google.cloud:native-image-support to v0.12.6 ([#1187](https://github.com/googleapis/java-bigtable/issues/1187)) ([b110d65](https://github.com/googleapis/java-bigtable/commit/b110d650edd38a1866f6c2168c78ec8e31b528c2)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.10 ([#1174](https://github.com/googleapis/java-bigtable/issues/1174)) ([7ff5fa7](https://github.com/googleapis/java-bigtable/commit/7ff5fa712b6dcbbd3c721c8babb8ed4e1c7dad17)) + ### [2.5.3](https://github.com/googleapis/java-bigtable/compare/v2.5.2...v2.5.3) (2022-02-08) diff --git a/README.md b/README.md index e285b78f7f..da2bb2de89 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 24.2.0 + 24.4.0 pom import @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigtable - 2.5.2 + 2.5.3 ``` @@ -49,20 +49,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.2.0') +implementation platform('com.google.cloud:libraries-bom:24.4.0') implementation 'com.google.cloud:google-cloud-bigtable' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigtable:2.5.2' +implementation 'com.google.cloud:google-cloud-bigtable:2.5.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.5.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.5.3" ``` ## Authentication @@ -472,6 +472,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigtable/tree | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Native Image Bigtable Sample | [source code](https://github.com/googleapis/java-bigtable/blob/main/samples/native-image-sample/src/main/java/com/example/bigtable/NativeImageBigtableSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/native-image-sample/src/main/java/com/example/bigtable/NativeImageBigtableSample.java) | | Configure Connection Pool | [source code](https://github.com/googleapis/java-bigtable/blob/main/samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java) | | Filters | [source code](https://github.com/googleapis/java-bigtable/blob/main/samples/snippets/src/main/java/com/example/bigtable/Filters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Filters.java) | | Hello World | [source code](https://github.com/googleapis/java-bigtable/blob/main/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java) | diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index 281d8a7680..497ef7e6ed 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 - 2.5.3 + 2.6.0 pom com.google.cloud @@ -62,32 +62,32 @@ com.google.cloud google-cloud-bigtable - 2.5.3 + 2.6.0 com.google.cloud google-cloud-bigtable-emulator - 0.142.3 + 0.143.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.6.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.5.3 + 2.6.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.6.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.5.3 + 2.6.0 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index 1d6cdaf886..4c8ccefa7c 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 - 2.5.3 + 2.6.0 pom @@ -65,7 +65,7 @@ com.google.cloud google-cloud-shared-dependencies - 2.7.0 + 2.8.0 pom import diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index a3758215ac..430dc3faf9 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.142.3 + 0.143.0 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.6.0 scm:git:git@github.com:googleapis/java-bigtable.git @@ -81,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.6.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.6.0 pom import diff --git a/google-cloud-bigtable-stats/pom.xml b/google-cloud-bigtable-stats/pom.xml index 4d55e456d7..6d63a53da3 100644 --- a/google-cloud-bigtable-stats/pom.xml +++ b/google-cloud-bigtable-stats/pom.xml @@ -5,7 +5,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.6.0 4.0.0 @@ -13,7 +13,7 @@ through Stackdriver. Built-in metrics will be implemented with shaded OpenCensus so it won't interfere with customer's application metrics. --> google-cloud-bigtable-stats - 2.5.3 + 2.6.0 Experimental project to shade OpenCensus dependencies. @@ -21,7 +21,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.6.0 pom import diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index c80aa6d05f..730330e40d 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 2.5.3 + 2.6.0 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.6.0 - 2.5.3 + 2.6.0 google-cloud-bigtable @@ -43,14 +43,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.6.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.6.0 pom import diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index 35fe7ced09..7d2e778773 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -20,6 +20,6 @@ @InternalApi("For internal use only") public final class Version { // {x-version-update-start:google-cloud-bigtable:current} - public static String VERSION = "2.5.3"; + public static String VERSION = "2.6.0"; // {x-version-update-end} } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json index 0891b90455..77b50a1f50 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json @@ -19,6 +19,9 @@ "MutateRows": { "methods": ["mutateRowsCallable"] }, + "PingAndWarm": { + "methods": ["pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarmCallable"] + }, "ReadModifyWriteRow": { "methods": ["readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRowCallable"] }, diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java index 316e156854..3d3164f823 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java @@ -26,6 +26,8 @@ import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadRowsRequest; @@ -62,6 +64,10 @@ public ServerStreamingCallable mutateRows throw new UnsupportedOperationException("Not implemented: checkAndMutateRowCallable()"); } + public UnaryCallable pingAndWarmCallable() { + throw new UnsupportedOperationException("Not implemented: pingAndWarmCallable()"); + } + public UnaryCallable readModifyWriteRowCallable() { throw new UnsupportedOperationException("Not implemented: readModifyWriteRowCallable()"); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index 0ec95f1488..aedcc29154 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -39,6 +39,8 @@ import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadRowsRequest; @@ -78,6 +80,7 @@ public class BigtableStubSettings extends StubSettings { mutateRowsSettings; private final UnaryCallSettings checkAndMutateRowSettings; + private final UnaryCallSettings pingAndWarmSettings; private final UnaryCallSettings readModifyWriteRowSettings; @@ -108,6 +111,11 @@ public ServerStreamingCallSettings mutate return checkAndMutateRowSettings; } + /** Returns the object with the settings used for calls to pingAndWarm. */ + public UnaryCallSettings pingAndWarmSettings() { + return pingAndWarmSettings; + } + /** Returns the object with the settings used for calls to readModifyWriteRow. */ public UnaryCallSettings readModifyWriteRowSettings() { @@ -194,6 +202,7 @@ protected BigtableStubSettings(Builder settingsBuilder) throws IOException { mutateRowSettings = settingsBuilder.mutateRowSettings().build(); mutateRowsSettings = settingsBuilder.mutateRowsSettings().build(); checkAndMutateRowSettings = settingsBuilder.checkAndMutateRowSettings().build(); + pingAndWarmSettings = settingsBuilder.pingAndWarmSettings().build(); readModifyWriteRowSettings = settingsBuilder.readModifyWriteRowSettings().build(); } @@ -209,6 +218,8 @@ public static class Builder extends StubSettings.Builder checkAndMutateRowSettings; + private final UnaryCallSettings.Builder + pingAndWarmSettings; private final UnaryCallSettings.Builder readModifyWriteRowSettings; private static final ImmutableMap> @@ -218,18 +229,19 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "retry_policy_4_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); definitions.put( - "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -240,26 +252,20 @@ public static class Builder extends StubSettings.Builder>of( - mutateRowSettings, checkAndMutateRowSettings, readModifyWriteRowSettings); + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings); initDefaults(this); } @@ -324,11 +330,15 @@ protected Builder(BigtableStubSettings settings) { mutateRowSettings = settings.mutateRowSettings.toBuilder(); mutateRowsSettings = settings.mutateRowsSettings.toBuilder(); checkAndMutateRowSettings = settings.checkAndMutateRowSettings.toBuilder(); + pingAndWarmSettings = settings.pingAndWarmSettings.toBuilder(); readModifyWriteRowSettings = settings.readModifyWriteRowSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - mutateRowSettings, checkAndMutateRowSettings, readModifyWriteRowSettings); + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings); } private static Builder createDefault() { @@ -347,13 +357,13 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder .readRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); builder .sampleRowKeysSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .mutateRowSettings() @@ -362,18 +372,23 @@ private static Builder initDefaults(Builder builder) { builder .mutateRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .checkAndMutateRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pingAndWarmSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .readModifyWriteRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); return builder; } @@ -422,6 +437,12 @@ public UnaryCallSettings.Builder mutateRowS return checkAndMutateRowSettings; } + /** Returns the builder for the settings used for calls to pingAndWarm. */ + public UnaryCallSettings.Builder + pingAndWarmSettings() { + return pingAndWarmSettings; + } + /** Returns the builder for the settings used for calls to readModifyWriteRow. */ public UnaryCallSettings.Builder readModifyWriteRowSettings() { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java index f51cc082c4..0b155ddbf9 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java @@ -22,21 +22,24 @@ import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; import com.google.bigtable.v2.CheckAndMutateRowRequest; import com.google.bigtable.v2.CheckAndMutateRowResponse; import com.google.bigtable.v2.MutateRowRequest; import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadRowsRequest; import com.google.bigtable.v2.ReadRowsResponse; import com.google.bigtable.v2.SampleRowKeysRequest; import com.google.bigtable.v2.SampleRowKeysResponse; -import com.google.common.collect.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -98,6 +101,16 @@ public class GrpcBigtableStub extends BigtableStub { ProtoUtils.marshaller(CheckAndMutateRowResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + pingAndWarmMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.v2.Bigtable/PingAndWarm") + .setRequestMarshaller(ProtoUtils.marshaller(PingAndWarmRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PingAndWarmResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor readModifyWriteRowMethodDescriptor = MethodDescriptor.newBuilder() @@ -116,6 +129,7 @@ public class GrpcBigtableStub extends BigtableStub { private final ServerStreamingCallable mutateRowsCallable; private final UnaryCallable checkAndMutateRowCallable; + private final UnaryCallable pingAndWarmCallable; private final UnaryCallable readModifyWriteRowCallable; @@ -123,6 +137,35 @@ public class GrpcBigtableStub extends BigtableStub { private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; + private static final PathTemplate READ_ROWS_0_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}"); + private static final PathTemplate READ_ROWS_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + private static final PathTemplate SAMPLE_ROW_KEYS_0_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}"); + private static final PathTemplate SAMPLE_ROW_KEYS_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + private static final PathTemplate MUTATE_ROW_0_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}"); + private static final PathTemplate MUTATE_ROW_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + private static final PathTemplate MUTATE_ROWS_0_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}"); + private static final PathTemplate MUTATE_ROWS_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + private static final PathTemplate CHECK_AND_MUTATE_ROW_0_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}"); + private static final PathTemplate CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + private static final PathTemplate PING_AND_WARM_0_PATH_TEMPLATE = + PathTemplate.create("{name=projects/*/instances/*}"); + private static final PathTemplate PING_AND_WARM_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + private static final PathTemplate READ_MODIFY_WRITE_ROW_0_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/tables/*}"); + private static final PathTemplate READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); + public static final GrpcBigtableStub create(BigtableStubSettings settings) throws IOException { return new GrpcBigtableStub(settings, ClientContext.create(settings)); } @@ -163,9 +206,11 @@ protected GrpcBigtableStub( .setMethodDescriptor(readRowsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getTableName(), "table_name", READ_ROWS_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", READ_ROWS_1_PATH_TEMPLATE); + return builder.build(); }) .build(); GrpcCallSettings sampleRowKeysTransportSettings = @@ -173,9 +218,12 @@ protected GrpcBigtableStub( .setMethodDescriptor(sampleRowKeysMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getTableName(), "table_name", SAMPLE_ROW_KEYS_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", SAMPLE_ROW_KEYS_1_PATH_TEMPLATE); + return builder.build(); }) .build(); GrpcCallSettings mutateRowTransportSettings = @@ -183,9 +231,11 @@ protected GrpcBigtableStub( .setMethodDescriptor(mutateRowMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getTableName(), "table_name", MUTATE_ROW_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", MUTATE_ROW_1_PATH_TEMPLATE); + return builder.build(); }) .build(); GrpcCallSettings mutateRowsTransportSettings = @@ -193,9 +243,11 @@ protected GrpcBigtableStub( .setMethodDescriptor(mutateRowsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getTableName(), "table_name", MUTATE_ROWS_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", MUTATE_ROWS_1_PATH_TEMPLATE); + return builder.build(); }) .build(); GrpcCallSettings @@ -204,20 +256,46 @@ protected GrpcBigtableStub( .setMethodDescriptor(checkAndMutateRowMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getTableName(), + "table_name", + CHECK_AND_MUTATE_ROW_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), + "app_profile_id", + CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE); + return builder.build(); }) .build(); + GrpcCallSettings pingAndWarmTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pingAndWarmMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "name", PING_AND_WARM_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", PING_AND_WARM_1_PATH_TEMPLATE); + return builder.build(); + }) + .build(); GrpcCallSettings readModifyWriteRowTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(readModifyWriteRowMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getTableName(), + "table_name", + READ_MODIFY_WRITE_ROW_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), + "app_profile_id", + READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE); + return builder.build(); }) .build(); @@ -238,6 +316,9 @@ protected GrpcBigtableStub( checkAndMutateRowTransportSettings, settings.checkAndMutateRowSettings(), clientContext); + this.pingAndWarmCallable = + callableFactory.createUnaryCallable( + pingAndWarmTransportSettings, settings.pingAndWarmSettings(), clientContext); this.readModifyWriteRowCallable = callableFactory.createUnaryCallable( readModifyWriteRowTransportSettings, @@ -279,6 +360,11 @@ public ServerStreamingCallable mutateRows return checkAndMutateRowCallable; } + @Override + public UnaryCallable pingAndWarmCallable() { + return pingAndWarmCallable; + } + @Override public UnaryCallable readModifyWriteRowCallable() { diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index 72e7e5cdc6..6929cd1a02 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 - 2.5.3 + 2.6.0 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.6.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.6.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.6.0 pom import @@ -74,7 +74,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 protected true diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index 8d7d9566f1..7835148337 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 - 2.5.3 + 2.6.0 grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.6.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.6.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.6.0 pom import @@ -66,7 +66,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 protected true diff --git a/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java b/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java index ddb99b378f..e6eaad7197 100644 --- a/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java +++ b/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java @@ -246,6 +246,47 @@ private BigtableGrpc() {} return getCheckAndMutateRowMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PingAndWarm", + requestType = com.google.bigtable.v2.PingAndWarmRequest.class, + responseType = com.google.bigtable.v2.PingAndWarmResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod; + if ((getPingAndWarmMethod = BigtableGrpc.getPingAndWarmMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getPingAndWarmMethod = BigtableGrpc.getPingAndWarmMethod) == null) { + BigtableGrpc.getPingAndWarmMethod = + getPingAndWarmMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PingAndWarm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.PingAndWarmRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.PingAndWarmResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("PingAndWarm")) + .build(); + } + } + } + return getPingAndWarmMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.bigtable.v2.ReadModifyWriteRowRequest, com.google.bigtable.v2.ReadModifyWriteRowResponse> @@ -421,6 +462,21 @@ public void checkAndMutateRow( getCheckAndMutateRowMethod(), responseObserver); } + /** + * + * + *
+     * Warm up associated instance metadata for this connection.
+     * This call is not required but may be useful for connection keep-alive.
+     * 
+ */ + public void pingAndWarm( + com.google.bigtable.v2.PingAndWarmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPingAndWarmMethod(), responseObserver); + } + /** * * @@ -475,6 +531,12 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.bigtable.v2.CheckAndMutateRowRequest, com.google.bigtable.v2.CheckAndMutateRowResponse>( this, METHODID_CHECK_AND_MUTATE_ROW))) + .addMethod( + getPingAndWarmMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.v2.PingAndWarmRequest, + com.google.bigtable.v2.PingAndWarmResponse>(this, METHODID_PING_AND_WARM))) .addMethod( getReadModifyWriteRowMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -589,6 +651,23 @@ public void checkAndMutateRow( responseObserver); } + /** + * + * + *
+     * Warm up associated instance metadata for this connection.
+     * This call is not required but may be useful for connection keep-alive.
+     * 
+ */ + public void pingAndWarm( + com.google.bigtable.v2.PingAndWarmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPingAndWarmMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -704,6 +783,20 @@ public com.google.bigtable.v2.CheckAndMutateRowResponse checkAndMutateRow( getChannel(), getCheckAndMutateRowMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Warm up associated instance metadata for this connection.
+     * This call is not required but may be useful for connection keep-alive.
+     * 
+ */ + public com.google.bigtable.v2.PingAndWarmResponse pingAndWarm( + com.google.bigtable.v2.PingAndWarmRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPingAndWarmMethod(), getCallOptions(), request); + } + /** * * @@ -769,6 +862,21 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getCheckAndMutateRowMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Warm up associated instance metadata for this connection.
+     * This call is not required but may be useful for connection keep-alive.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.v2.PingAndWarmResponse> + pingAndWarm(com.google.bigtable.v2.PingAndWarmRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPingAndWarmMethod(), getCallOptions()), request); + } + /** * * @@ -793,7 +901,8 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions private static final int METHODID_MUTATE_ROW = 2; private static final int METHODID_MUTATE_ROWS = 3; private static final int METHODID_CHECK_AND_MUTATE_ROW = 4; - private static final int METHODID_READ_MODIFY_WRITE_ROW = 5; + private static final int METHODID_PING_AND_WARM = 5; + private static final int METHODID_READ_MODIFY_WRITE_ROW = 6; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -842,6 +951,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_PING_AND_WARM: + serviceImpl.pingAndWarm( + (com.google.bigtable.v2.PingAndWarmRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; case METHODID_READ_MODIFY_WRITE_ROW: serviceImpl.readModifyWriteRow( (com.google.bigtable.v2.ReadModifyWriteRowRequest) request, @@ -915,6 +1030,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getMutateRowMethod()) .addMethod(getMutateRowsMethod()) .addMethod(getCheckAndMutateRowMethod()) + .addMethod(getPingAndWarmMethod()) .addMethod(getReadModifyWriteRowMethod()) .build(); } diff --git a/pom.xml b/pom.xml index e8e5ef249e..4cf327214d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 2.5.3 + 2.6.0 Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -152,27 +152,27 @@ com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.5.3 + 2.6.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.6.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.5.3 + 2.6.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.6.0 com.google.cloud google-cloud-bigtable - 2.5.3 + 2.6.0 @@ -225,7 +225,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 aggregate @@ -308,7 +308,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 com.microsoft.doclet.DocFxDoclet false diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index 8037ba0f9e..5f52acf6dd 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 - 2.5.3 + 2.6.0 proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.6.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.6.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.6.0 pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index de2ae94dd9..35f316e6d2 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 - 2.5.3 + 2.6.0 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.6.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.6.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.6.0 pom import diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java index 2faa963ae0..2e7276b4de 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java @@ -79,6 +79,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -100,113 +108,138 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "gle.bigtable.v2\032\034google/api/annotations." + "proto\032\027google/api/client.proto\032\037google/a" + "pi/field_behavior.proto\032\031google/api/reso" - + "urce.proto\032\035google/bigtable/v2/data.prot" - + "o\032\036google/protobuf/wrappers.proto\032\027googl" - + "e/rpc/status.proto\"\326\001\n\017ReadRowsRequest\022>" - + "\n\ntable_name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmi" - + "n.googleapis.com/Table\022\026\n\016app_profile_id" - + "\030\005 \001(\t\022(\n\004rows\030\002 \001(\0132\032.google.bigtable.v" - + "2.RowSet\022-\n\006filter\030\003 \001(\0132\035.google.bigtab" - + "le.v2.RowFilter\022\022\n\nrows_limit\030\004 \001(\003\"\370\002\n\020" - + "ReadRowsResponse\022>\n\006chunks\030\001 \003(\0132..googl" - + "e.bigtable.v2.ReadRowsResponse.CellChunk" - + "\022\034\n\024last_scanned_row_key\030\002 \001(\014\032\205\002\n\tCellC" - + "hunk\022\017\n\007row_key\030\001 \001(\014\0221\n\013family_name\030\002 \001" - + "(\0132\034.google.protobuf.StringValue\022.\n\tqual" - + "ifier\030\003 \001(\0132\033.google.protobuf.BytesValue" - + "\022\030\n\020timestamp_micros\030\004 \001(\003\022\016\n\006labels\030\005 \003" - + "(\t\022\r\n\005value\030\006 \001(\014\022\022\n\nvalue_size\030\007 \001(\005\022\023\n" - + "\treset_row\030\010 \001(\010H\000\022\024\n\ncommit_row\030\t \001(\010H\000" - + "B\014\n\nrow_status\"n\n\024SampleRowKeysRequest\022>" - + "\n\ntable_name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmi" - + "n.googleapis.com/Table\022\026\n\016app_profile_id" - + "\030\002 \001(\t\">\n\025SampleRowKeysResponse\022\017\n\007row_k" - + "ey\030\001 \001(\014\022\024\n\014offset_bytes\030\002 \001(\003\"\266\001\n\020Mutat" - + "eRowRequest\022>\n\ntable_name\030\001 \001(\tB*\340A\002\372A$\n" - + "\"bigtableadmin.googleapis.com/Table\022\026\n\016a" - + "pp_profile_id\030\004 \001(\t\022\024\n\007row_key\030\002 \001(\014B\003\340A" - + "\002\0224\n\tmutations\030\003 \003(\0132\034.google.bigtable.v" - + "2.MutationB\003\340A\002\"\023\n\021MutateRowResponse\"\376\001\n" - + "\021MutateRowsRequest\022>\n\ntable_name\030\001 \001(\tB*" - + "\340A\002\372A$\n\"bigtableadmin.googleapis.com/Tab" - + "le\022\026\n\016app_profile_id\030\003 \001(\t\022A\n\007entries\030\002 " - + "\003(\0132+.google.bigtable.v2.MutateRowsReque" - + "st.EntryB\003\340A\002\032N\n\005Entry\022\017\n\007row_key\030\001 \001(\014\022" - + "4\n\tmutations\030\002 \003(\0132\034.google.bigtable.v2." - + "MutationB\003\340A\002\"\217\001\n\022MutateRowsResponse\022=\n\007" - + "entries\030\001 \003(\0132,.google.bigtable.v2.Mutat" - + "eRowsResponse.Entry\032:\n\005Entry\022\r\n\005index\030\001 " - + "\001(\003\022\"\n\006status\030\002 \001(\0132\022.google.rpc.Status\"" - + "\256\002\n\030CheckAndMutateRowRequest\022>\n\ntable_na" - + "me\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmin.googleap" - + "is.com/Table\022\026\n\016app_profile_id\030\007 \001(\t\022\024\n\007" - + "row_key\030\002 \001(\014B\003\340A\002\0227\n\020predicate_filter\030\006" - + " \001(\0132\035.google.bigtable.v2.RowFilter\0224\n\016t" - + "rue_mutations\030\004 \003(\0132\034.google.bigtable.v2" - + ".Mutation\0225\n\017false_mutations\030\005 \003(\0132\034.goo" - + "gle.bigtable.v2.Mutation\"6\n\031CheckAndMuta" - + "teRowResponse\022\031\n\021predicate_matched\030\001 \001(\010" - + "\"\306\001\n\031ReadModifyWriteRowRequest\022>\n\ntable_" - + "name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmin.google" - + "apis.com/Table\022\026\n\016app_profile_id\030\004 \001(\t\022\024" - + "\n\007row_key\030\002 \001(\014B\003\340A\002\022;\n\005rules\030\003 \003(\0132\'.go" - + "ogle.bigtable.v2.ReadModifyWriteRuleB\003\340A" - + "\002\"B\n\032ReadModifyWriteRowResponse\022$\n\003row\030\001" - + " \001(\0132\027.google.bigtable.v2.Row2\304\016\n\010Bigtab" - + "le\022\306\001\n\010ReadRows\022#.google.bigtable.v2.Rea" - + "dRowsRequest\032$.google.bigtable.v2.ReadRo" - + "wsResponse\"m\202\323\344\223\002>\"9/v2/{table_name=proj" - + "ects/*/instances/*/tables/*}:readRows:\001*" - + "\332A\ntable_name\332A\031table_name,app_profile_i" - + "d0\001\022\327\001\n\rSampleRowKeys\022(.google.bigtable." - + "v2.SampleRowKeysRequest\032).google.bigtabl" - + "e.v2.SampleRowKeysResponse\"o\202\323\344\223\002@\022>/v2/" - + "{table_name=projects/*/instances/*/table" - + "s/*}:sampleRowKeys\332A\ntable_name\332A\031table_" - + "name,app_profile_id0\001\022\355\001\n\tMutateRow\022$.go" - + "ogle.bigtable.v2.MutateRowRequest\032%.goog" - + "le.bigtable.v2.MutateRowResponse\"\222\001\202\323\344\223\002" - + "?\":/v2/{table_name=projects/*/instances/" - + "*/tables/*}:mutateRow:\001*\332A\034table_name,ro" - + "w_key,mutations\332A+table_name,row_key,mut" - + "ations,app_profile_id\022\336\001\n\nMutateRows\022%.g" - + "oogle.bigtable.v2.MutateRowsRequest\032&.go" - + "ogle.bigtable.v2.MutateRowsResponse\"\177\202\323\344" - + "\223\002@\";/v2/{table_name=projects/*/instance" - + "s/*/tables/*}:mutateRows:\001*\332A\022table_name" - + ",entries\332A!table_name,entries,app_profil" - + "e_id0\001\022\331\002\n\021CheckAndMutateRow\022,.google.bi" - + "gtable.v2.CheckAndMutateRowRequest\032-.goo" - + "gle.bigtable.v2.CheckAndMutateRowRespons" - + "e\"\346\001\202\323\344\223\002G\"B/v2/{table_name=projects/*/i" - + "nstances/*/tables/*}:checkAndMutateRow:\001" - + "*\332ABtable_name,row_key,predicate_filter," - + "true_mutations,false_mutations\332AQtable_n" - + "ame,row_key,predicate_filter,true_mutati" - + "ons,false_mutations,app_profile_id\022\211\002\n\022R" - + "eadModifyWriteRow\022-.google.bigtable.v2.R" - + "eadModifyWriteRowRequest\032..google.bigtab" - + "le.v2.ReadModifyWriteRowResponse\"\223\001\202\323\344\223\002" - + "H\"C/v2/{table_name=projects/*/instances/" - + "*/tables/*}:readModifyWriteRow:\001*\332A\030tabl" - + "e_name,row_key,rules\332A\'table_name,row_ke" - + "y,rules,app_profile_id\032\333\002\312A\027bigtable.goo" - + "gleapis.com\322A\275\002https://www.googleapis.co" - + "m/auth/bigtable.data,https://www.googlea" - + "pis.com/auth/bigtable.data.readonly,http" - + "s://www.googleapis.com/auth/cloud-bigtab" - + "le.data,https://www.googleapis.com/auth/" - + "cloud-bigtable.data.readonly,https://www" - + ".googleapis.com/auth/cloud-platform,http" - + "s://www.googleapis.com/auth/cloud-platfo" - + "rm.read-onlyB\230\002\n\026com.google.bigtable.v2B" - + "\rBigtableProtoP\001Z:google.golang.org/genp" - + "roto/googleapis/bigtable/v2;bigtable\252\002\030G" - + "oogle.Cloud.Bigtable.V2\312\002\030Google\\Cloud\\B" - + "igtable\\V2\352\002\033Google::Cloud::Bigtable::V2" - + "\352A\\\n\"bigtableadmin.googleapis.com/Table\022" - + "6projects/{project}/instances/{instance}" - + "/tables/{table}b\006proto3" + + "urce.proto\032\030google/api/routing.proto\032\035go" + + "ogle/bigtable/v2/data.proto\032\036google/prot" + + "obuf/wrappers.proto\032\027google/rpc/status.p" + + "roto\"\326\001\n\017ReadRowsRequest\022>\n\ntable_name\030\001" + + " \001(\tB*\340A\002\372A$\n\"bigtableadmin.googleapis.c" + + "om/Table\022\026\n\016app_profile_id\030\005 \001(\t\022(\n\004rows" + + "\030\002 \001(\0132\032.google.bigtable.v2.RowSet\022-\n\006fi" + + "lter\030\003 \001(\0132\035.google.bigtable.v2.RowFilte" + + "r\022\022\n\nrows_limit\030\004 \001(\003\"\370\002\n\020ReadRowsRespon" + + "se\022>\n\006chunks\030\001 \003(\0132..google.bigtable.v2." + + "ReadRowsResponse.CellChunk\022\034\n\024last_scann" + + "ed_row_key\030\002 \001(\014\032\205\002\n\tCellChunk\022\017\n\007row_ke" + + "y\030\001 \001(\014\0221\n\013family_name\030\002 \001(\0132\034.google.pr" + + "otobuf.StringValue\022.\n\tqualifier\030\003 \001(\0132\033." + + "google.protobuf.BytesValue\022\030\n\020timestamp_" + + "micros\030\004 \001(\003\022\016\n\006labels\030\005 \003(\t\022\r\n\005value\030\006 " + + "\001(\014\022\022\n\nvalue_size\030\007 \001(\005\022\023\n\treset_row\030\010 \001" + + "(\010H\000\022\024\n\ncommit_row\030\t \001(\010H\000B\014\n\nrow_status" + + "\"n\n\024SampleRowKeysRequest\022>\n\ntable_name\030\001" + + " \001(\tB*\340A\002\372A$\n\"bigtableadmin.googleapis.c" + + "om/Table\022\026\n\016app_profile_id\030\002 \001(\t\">\n\025Samp" + + "leRowKeysResponse\022\017\n\007row_key\030\001 \001(\014\022\024\n\014of" + + "fset_bytes\030\002 \001(\003\"\266\001\n\020MutateRowRequest\022>\n" + + "\ntable_name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmin" + + ".googleapis.com/Table\022\026\n\016app_profile_id\030" + + "\004 \001(\t\022\024\n\007row_key\030\002 \001(\014B\003\340A\002\0224\n\tmutations" + + "\030\003 \003(\0132\034.google.bigtable.v2.MutationB\003\340A" + + "\002\"\023\n\021MutateRowResponse\"\376\001\n\021MutateRowsReq" + + "uest\022>\n\ntable_name\030\001 \001(\tB*\340A\002\372A$\n\"bigtab" + + "leadmin.googleapis.com/Table\022\026\n\016app_prof" + + "ile_id\030\003 \001(\t\022A\n\007entries\030\002 \003(\0132+.google.b" + + "igtable.v2.MutateRowsRequest.EntryB\003\340A\002\032" + + "N\n\005Entry\022\017\n\007row_key\030\001 \001(\014\0224\n\tmutations\030\002" + + " \003(\0132\034.google.bigtable.v2.MutationB\003\340A\002\"" + + "\217\001\n\022MutateRowsResponse\022=\n\007entries\030\001 \003(\0132" + + ",.google.bigtable.v2.MutateRowsResponse." + + "Entry\032:\n\005Entry\022\r\n\005index\030\001 \001(\003\022\"\n\006status\030" + + "\002 \001(\0132\022.google.rpc.Status\"\256\002\n\030CheckAndMu" + + "tateRowRequest\022>\n\ntable_name\030\001 \001(\tB*\340A\002\372" + + "A$\n\"bigtableadmin.googleapis.com/Table\022\026" + + "\n\016app_profile_id\030\007 \001(\t\022\024\n\007row_key\030\002 \001(\014B" + + "\003\340A\002\0227\n\020predicate_filter\030\006 \001(\0132\035.google." + + "bigtable.v2.RowFilter\0224\n\016true_mutations\030" + + "\004 \003(\0132\034.google.bigtable.v2.Mutation\0225\n\017f" + + "alse_mutations\030\005 \003(\0132\034.google.bigtable.v" + + "2.Mutation\"6\n\031CheckAndMutateRowResponse\022" + + "\031\n\021predicate_matched\030\001 \001(\010\"i\n\022PingAndWar" + + "mRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%bigtable" + + "admin.googleapis.com/Instance\022\026\n\016app_pro" + + "file_id\030\002 \001(\t\"\025\n\023PingAndWarmResponse\"\306\001\n" + + "\031ReadModifyWriteRowRequest\022>\n\ntable_name" + + "\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmin.googleapis" + + ".com/Table\022\026\n\016app_profile_id\030\004 \001(\t\022\024\n\007ro" + + "w_key\030\002 \001(\014B\003\340A\002\022;\n\005rules\030\003 \003(\0132\'.google" + + ".bigtable.v2.ReadModifyWriteRuleB\003\340A\002\"B\n" + + "\032ReadModifyWriteRowResponse\022$\n\003row\030\001 \001(\013" + + "2\027.google.bigtable.v2.Row2\260\024\n\010Bigtable\022\233" + + "\002\n\010ReadRows\022#.google.bigtable.v2.ReadRow" + + "sRequest\032$.google.bigtable.v2.ReadRowsRe" + + "sponse\"\301\001\202\323\344\223\002>\"9/v2/{table_name=project" + + "s/*/instances/*/tables/*}:readRows:\001*\212\323\344" + + "\223\002N\022:\n\ntable_name\022,{table_name=projects/" + + "*/instances/*/tables/*}\022\020\n\016app_profile_i" + + "d\332A\ntable_name\332A\031table_name,app_profile_" + + "id0\001\022\254\002\n\rSampleRowKeys\022(.google.bigtable" + + ".v2.SampleRowKeysRequest\032).google.bigtab" + + "le.v2.SampleRowKeysResponse\"\303\001\202\323\344\223\002@\022>/v" + + "2/{table_name=projects/*/instances/*/tab" + + "les/*}:sampleRowKeys\212\323\344\223\002N\022:\n\ntable_name" + + "\022,{table_name=projects/*/instances/*/tab" + + "les/*}\022\020\n\016app_profile_id\332A\ntable_name\332A\031" + + "table_name,app_profile_id0\001\022\301\002\n\tMutateRo" + + "w\022$.google.bigtable.v2.MutateRowRequest\032" + + "%.google.bigtable.v2.MutateRowResponse\"\346" + + "\001\202\323\344\223\002?\":/v2/{table_name=projects/*/inst" + + "ances/*/tables/*}:mutateRow:\001*\212\323\344\223\002N\022:\n\n" + + "table_name\022,{table_name=projects/*/insta" + + "nces/*/tables/*}\022\020\n\016app_profile_id\332A\034tab" + + "le_name,row_key,mutations\332A+table_name,r" + + "ow_key,mutations,app_profile_id\022\263\002\n\nMuta" + + "teRows\022%.google.bigtable.v2.MutateRowsRe" + + "quest\032&.google.bigtable.v2.MutateRowsRes" + + "ponse\"\323\001\202\323\344\223\002@\";/v2/{table_name=projects" + + "/*/instances/*/tables/*}:mutateRows:\001*\212\323" + + "\344\223\002N\022:\n\ntable_name\022,{table_name=projects" + + "/*/instances/*/tables/*}\022\020\n\016app_profile_" + + "id\332A\022table_name,entries\332A!table_name,ent" + + "ries,app_profile_id0\001\022\255\003\n\021CheckAndMutate" + + "Row\022,.google.bigtable.v2.CheckAndMutateR" + + "owRequest\032-.google.bigtable.v2.CheckAndM" + + "utateRowResponse\"\272\002\202\323\344\223\002G\"B/v2/{table_na" + + "me=projects/*/instances/*/tables/*}:chec" + + "kAndMutateRow:\001*\212\323\344\223\002N\022:\n\ntable_name\022,{t" + + "able_name=projects/*/instances/*/tables/" + + "*}\022\020\n\016app_profile_id\332ABtable_name,row_ke" + + "y,predicate_filter,true_mutations,false_" + + "mutations\332AQtable_name,row_key,predicate" + + "_filter,true_mutations,false_mutations,a" + + "pp_profile_id\022\356\001\n\013PingAndWarm\022&.google.b" + + "igtable.v2.PingAndWarmRequest\032\'.google.b" + + "igtable.v2.PingAndWarmResponse\"\215\001\202\323\344\223\002+\"" + + "&/v2/{name=projects/*/instances/*}:ping:" + + "\001*\212\323\344\223\0029\022%\n\004name\022\035{name=projects/*/insta" + + "nces/*}\022\020\n\016app_profile_id\332A\004name\332A\023name," + + "app_profile_id\022\335\002\n\022ReadModifyWriteRow\022-." + + "google.bigtable.v2.ReadModifyWriteRowReq" + + "uest\032..google.bigtable.v2.ReadModifyWrit" + + "eRowResponse\"\347\001\202\323\344\223\002H\"C/v2/{table_name=p" + + "rojects/*/instances/*/tables/*}:readModi" + + "fyWriteRow:\001*\212\323\344\223\002N\022:\n\ntable_name\022,{tabl" + + "e_name=projects/*/instances/*/tables/*}\022" + + "\020\n\016app_profile_id\332A\030table_name,row_key,r" + + "ules\332A\'table_name,row_key,rules,app_prof" + + "ile_id\032\333\002\312A\027bigtable.googleapis.com\322A\275\002h" + + "ttps://www.googleapis.com/auth/bigtable." + + "data,https://www.googleapis.com/auth/big" + + "table.data.readonly,https://www.googleap" + + "is.com/auth/cloud-bigtable.data,https://" + + "www.googleapis.com/auth/cloud-bigtable.d" + + "ata.readonly,https://www.googleapis.com/" + + "auth/cloud-platform,https://www.googleap" + + "is.com/auth/cloud-platform.read-onlyB\353\002\n" + + "\026com.google.bigtable.v2B\rBigtableProtoP\001" + + "Z:google.golang.org/genproto/googleapis/" + + "bigtable/v2;bigtable\252\002\030Google.Cloud.Bigt" + + "able.V2\312\002\030Google\\Cloud\\Bigtable\\V2\352\002\033Goo" + + "gle::Cloud::Bigtable::V2\352A\\\n\"bigtableadm" + + "in.googleapis.com/Table\0226projects/{proje" + + "ct}/instances/{instance}/tables/{table}\352" + + "AP\n%bigtableadmin.googleapis.com/Instanc" + + "e\022\'projects/{project}/instances/{instanc" + + "e}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -216,6 +249,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.api.RoutingProto.getDescriptor(), com.google.bigtable.v2.DataProto.getDescriptor(), com.google.protobuf.WrappersProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), @@ -336,8 +370,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "PredicateMatched", }); - internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor = + internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor, + new java.lang.String[] { + "Name", "AppProfileId", + }); + internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor = + getDescriptor().getMessageTypes().get(12); internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor, @@ -345,7 +393,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "TableName", "AppProfileId", "RowKey", "Rules", }); internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor, @@ -361,12 +409,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ClientProto.oauthScopes); registry.add(com.google.api.ResourceProto.resourceDefinition); registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.api.RoutingProto.routing); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.AnnotationsProto.getDescriptor(); com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.api.RoutingProto.getDescriptor(); com.google.bigtable.v2.DataProto.getDescriptor(); com.google.protobuf.WrappersProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java new file mode 100644 index 0000000000..abb1cf099c --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2021 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 + * + * https://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. + */ + +package com.google.bigtable.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class InstanceName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String instance) { + return newBuilder().setProject(project).setInstance(instance).build(); + } + + public static String format(String project, String instance) { + return newBuilder().setProject(project).setInstance(instance).build().toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE.instantiate("project", project, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** Builder for projects/{project}/instances/{instance}. */ + public static class Builder { + private String project; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java new file mode 100644 index 0000000000..8135f48382 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java @@ -0,0 +1,841 @@ +/* + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Request message for client connection keep-alive and warming.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.PingAndWarmRequest} + */ +public final class PingAndWarmRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PingAndWarmRequest) + PingAndWarmRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PingAndWarmRequest.newBuilder() to construct. + private PingAndWarmRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PingAndWarmRequest() { + name_ = ""; + appProfileId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PingAndWarmRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PingAndWarmRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + appProfileId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PingAndWarmRequest.class, + com.google.bigtable.v2.PingAndWarmRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The unique name of the instance to check permissions for as well as
+   * respond. Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The unique name of the instance to check permissions for as well as
+   * respond. Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appProfileId_; + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + @java.lang.Override + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appProfileId_ = s; + return s; + } + } + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appProfileId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appProfileId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.PingAndWarmRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.PingAndWarmRequest other = + (com.google.bigtable.v2.PingAndWarmRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.PingAndWarmRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for client connection keep-alive and warming.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.PingAndWarmRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.PingAndWarmRequest) + com.google.bigtable.v2.PingAndWarmRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PingAndWarmRequest.class, + com.google.bigtable.v2.PingAndWarmRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.PingAndWarmRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + appProfileId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.PingAndWarmRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.PingAndWarmRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.PingAndWarmRequest build() { + com.google.bigtable.v2.PingAndWarmRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.PingAndWarmRequest buildPartial() { + com.google.bigtable.v2.PingAndWarmRequest result = + new com.google.bigtable.v2.PingAndWarmRequest(this); + result.name_ = name_; + result.appProfileId_ = appProfileId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.PingAndWarmRequest) { + return mergeFrom((com.google.bigtable.v2.PingAndWarmRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.PingAndWarmRequest other) { + if (other == com.google.bigtable.v2.PingAndWarmRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.bigtable.v2.PingAndWarmRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.bigtable.v2.PingAndWarmRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The unique name of the instance to check permissions for as well as
+     * respond. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The unique name of the instance to check permissions for as well as
+     * respond. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The unique name of the instance to check permissions for as well as
+     * respond. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The unique name of the instance to check permissions for as well as
+     * respond. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The unique name of the instance to check permissions for as well as
+     * respond. Values are of the form `projects/<project>/instances/<instance>`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appProfileId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 2; + * + * @param value The appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appProfileId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + + appProfileId_ = getDefaultInstance().getAppProfileId(); + onChanged(); + return this; + } + /** + * + * + *
+     * This value specifies routing for replication. If not specified, the
+     * "default" application profile will be used.
+     * 
+ * + * string app_profile_id = 2; + * + * @param value The bytes for appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appProfileId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.PingAndWarmRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.PingAndWarmRequest) + private static final com.google.bigtable.v2.PingAndWarmRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.PingAndWarmRequest(); + } + + public static com.google.bigtable.v2.PingAndWarmRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PingAndWarmRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PingAndWarmRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.PingAndWarmRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java new file mode 100644 index 0000000000..026de7db51 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +package com.google.bigtable.v2; + +public interface PingAndWarmRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PingAndWarmRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance to check permissions for as well as
+   * respond. Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The unique name of the instance to check permissions for as well as
+   * respond. Values are of the form `projects/<project>/instances/<instance>`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + /** + * + * + *
+   * This value specifies routing for replication. If not specified, the
+   * "default" application profile will be used.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java new file mode 100644 index 0000000000..5fee559347 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java @@ -0,0 +1,454 @@ +/* + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Response message for Bigtable.PingAndWarm connection keepalive and warming.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.PingAndWarmResponse} + */ +public final class PingAndWarmResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PingAndWarmResponse) + PingAndWarmResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PingAndWarmResponse.newBuilder() to construct. + private PingAndWarmResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PingAndWarmResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PingAndWarmResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PingAndWarmResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PingAndWarmResponse.class, + com.google.bigtable.v2.PingAndWarmResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.PingAndWarmResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.PingAndWarmResponse other = + (com.google.bigtable.v2.PingAndWarmResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.PingAndWarmResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for Bigtable.PingAndWarm connection keepalive and warming.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.PingAndWarmResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.PingAndWarmResponse) + com.google.bigtable.v2.PingAndWarmResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PingAndWarmResponse.class, + com.google.bigtable.v2.PingAndWarmResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.PingAndWarmResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.PingAndWarmResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.PingAndWarmResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.PingAndWarmResponse build() { + com.google.bigtable.v2.PingAndWarmResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.PingAndWarmResponse buildPartial() { + com.google.bigtable.v2.PingAndWarmResponse result = + new com.google.bigtable.v2.PingAndWarmResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.PingAndWarmResponse) { + return mergeFrom((com.google.bigtable.v2.PingAndWarmResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.PingAndWarmResponse other) { + if (other == com.google.bigtable.v2.PingAndWarmResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.bigtable.v2.PingAndWarmResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.bigtable.v2.PingAndWarmResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.PingAndWarmResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.PingAndWarmResponse) + private static final com.google.bigtable.v2.PingAndWarmResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.PingAndWarmResponse(); + } + + public static com.google.bigtable.v2.PingAndWarmResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PingAndWarmResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PingAndWarmResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.PingAndWarmResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.java new file mode 100644 index 0000000000..df24aaa044 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +package com.google.bigtable.v2; + +public interface PingAndWarmResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PingAndWarmResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java index 5b1b58b6a0..9ecd26e8c3 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java @@ -267,7 +267,8 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { * * *
-   * The row keys and/or ranges to read. If not specified, reads from all rows.
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
    * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -282,7 +283,8 @@ public boolean hasRows() { * * *
-   * The row keys and/or ranges to read. If not specified, reads from all rows.
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
    * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -297,7 +299,8 @@ public com.google.bigtable.v2.RowSet getRows() { * * *
-   * The row keys and/or ranges to read. If not specified, reads from all rows.
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
    * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -362,7 +365,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { * * *
-   * The read will terminate after committing to N rows' worth of results. The
+   * The read will stop after committing to N rows' worth of results. The
    * default (zero) is to return all results.
    * 
* @@ -1024,7 +1027,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1038,7 +1042,8 @@ public boolean hasRows() { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1056,7 +1061,8 @@ public com.google.bigtable.v2.RowSet getRows() { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1078,7 +1084,8 @@ public Builder setRows(com.google.bigtable.v2.RowSet value) { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1097,7 +1104,8 @@ public Builder setRows(com.google.bigtable.v2.RowSet.Builder builderForValue) { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1120,7 +1128,8 @@ public Builder mergeRows(com.google.bigtable.v2.RowSet value) { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1140,7 +1149,8 @@ public Builder clearRows() { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1154,7 +1164,8 @@ public com.google.bigtable.v2.RowSet.Builder getRowsBuilder() { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1170,7 +1181,8 @@ public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { * * *
-     * The row keys and/or ranges to read. If not specified, reads from all rows.
+     * The row keys and/or ranges to read sequentially. If not specified, reads
+     * from all rows.
      * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -1385,7 +1397,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { * * *
-     * The read will terminate after committing to N rows' worth of results. The
+     * The read will stop after committing to N rows' worth of results. The
      * default (zero) is to return all results.
      * 
* @@ -1401,7 +1413,7 @@ public long getRowsLimit() { * * *
-     * The read will terminate after committing to N rows' worth of results. The
+     * The read will stop after committing to N rows' worth of results. The
      * default (zero) is to return all results.
      * 
* @@ -1420,7 +1432,7 @@ public Builder setRowsLimit(long value) { * * *
-     * The read will terminate after committing to N rows' worth of results. The
+     * The read will stop after committing to N rows' worth of results. The
      * default (zero) is to return all results.
      * 
* diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java index a38045db61..9455f46c5c 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java @@ -87,7 +87,8 @@ public interface ReadRowsRequestOrBuilder * * *
-   * The row keys and/or ranges to read. If not specified, reads from all rows.
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
    * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -99,7 +100,8 @@ public interface ReadRowsRequestOrBuilder * * *
-   * The row keys and/or ranges to read. If not specified, reads from all rows.
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
    * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -111,7 +113,8 @@ public interface ReadRowsRequestOrBuilder * * *
-   * The row keys and/or ranges to read. If not specified, reads from all rows.
+   * The row keys and/or ranges to read sequentially. If not specified, reads
+   * from all rows.
    * 
* * .google.bigtable.v2.RowSet rows = 2; @@ -160,7 +163,7 @@ public interface ReadRowsRequestOrBuilder * * *
-   * The read will terminate after committing to N rows' worth of results. The
+   * The read will stop after committing to N rows' worth of results. The
    * default (zero) is to return all results.
    * 
* diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java index d66bc4ee94..e23c74e087 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java @@ -48,7 +48,7 @@ * * Chains and interleaves are described in more detail in the * RowFilter.Chain and RowFilter.Interleave documentation. * The total serialized size of a RowFilter message must not - * exceed 4096 bytes, and RowFilters may not be nested within each other + * exceed 20480 bytes, and RowFilters may not be nested within each other * (in Chains or Interleaves) to a depth of more than 20. * * @@ -6014,7 +6014,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Chains and interleaves are described in more detail in the * RowFilter.Chain and RowFilter.Interleave documentation. * The total serialized size of a RowFilter message must not - * exceed 4096 bytes, and RowFilters may not be nested within each other + * exceed 20480 bytes, and RowFilters may not be nested within each other * (in Chains or Interleaves) to a depth of more than 20. * * diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto index 94a8428429..215b573cbd 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/api/routing.proto"; import "google/bigtable/v2/data.proto"; import "google/protobuf/wrappers.proto"; import "google/rpc/status.proto"; @@ -35,6 +36,10 @@ option (google.api.resource_definition) = { type: "bigtableadmin.googleapis.com/Table" pattern: "projects/{project}/instances/{instance}/tables/{table}" }; +option (google.api.resource_definition) = { + type: "bigtableadmin.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" +}; // Service for reading from and writing to existing Bigtable tables. service Bigtable { @@ -57,6 +62,15 @@ service Bigtable { post: "/v2/{table_name=projects/*/instances/*/tables/*}:readRows" body: "*" }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { + field: "app_profile_id" + } + }; option (google.api.method_signature) = "table_name"; option (google.api.method_signature) = "table_name,app_profile_id"; } @@ -69,6 +83,15 @@ service Bigtable { option (google.api.http) = { get: "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys" }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { + field: "app_profile_id" + } + }; option (google.api.method_signature) = "table_name"; option (google.api.method_signature) = "table_name,app_profile_id"; } @@ -80,6 +103,15 @@ service Bigtable { post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow" body: "*" }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { + field: "app_profile_id" + } + }; option (google.api.method_signature) = "table_name,row_key,mutations"; option (google.api.method_signature) = "table_name,row_key,mutations,app_profile_id"; } @@ -92,6 +124,15 @@ service Bigtable { post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows" body: "*" }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { + field: "app_profile_id" + } + }; option (google.api.method_signature) = "table_name,entries"; option (google.api.method_signature) = "table_name,entries,app_profile_id"; } @@ -102,10 +143,39 @@ service Bigtable { post: "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow" body: "*" }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { + field: "app_profile_id" + } + }; option (google.api.method_signature) = "table_name,row_key,predicate_filter,true_mutations,false_mutations"; option (google.api.method_signature) = "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id"; } + // Warm up associated instance metadata for this connection. + // This call is not required but may be useful for connection keep-alive. + rpc PingAndWarm(PingAndWarmRequest) returns (PingAndWarmResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*}:ping" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{name=projects/*/instances/*}" + } + routing_parameters { + field: "app_profile_id" + } + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,app_profile_id"; + } + // Modifies a row atomically on the server. The method reads the latest // existing timestamp and value from the specified columns and writes a new // entry based on pre-defined read/modify/write rules. The new value for the @@ -116,6 +186,15 @@ service Bigtable { post: "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow" body: "*" }; + option (google.api.routing) = { + routing_parameters { + field: "table_name" + path_template: "{table_name=projects/*/instances/*/tables/*}" + } + routing_parameters { + field: "app_profile_id" + } + }; option (google.api.method_signature) = "table_name,row_key,rules"; option (google.api.method_signature) = "table_name,row_key,rules,app_profile_id"; } @@ -137,14 +216,15 @@ message ReadRowsRequest { // "default" application profile will be used. string app_profile_id = 5; - // The row keys and/or ranges to read. If not specified, reads from all rows. + // The row keys and/or ranges to read sequentially. If not specified, reads + // from all rows. RowSet rows = 2; // The filter to apply to the contents of the specified row(s). If unset, // reads the entirety of each row. RowFilter filter = 3; - // The read will terminate after committing to N rows' worth of results. The + // The read will stop after committing to N rows' worth of results. The // default (zero) is to return all results. int64 rows_limit = 4; } @@ -394,6 +474,27 @@ message CheckAndMutateRowResponse { bool predicate_matched = 1; } +// Request message for client connection keep-alive and warming. +message PingAndWarmRequest { + // Required. The unique name of the instance to check permissions for as well as + // respond. Values are of the form `projects//instances/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 2; +} + +// Response message for Bigtable.PingAndWarm connection keepalive and warming. +message PingAndWarmResponse { + +} + // Request message for Bigtable.ReadModifyWriteRow. message ReadModifyWriteRowRequest { // Required. The unique name of the table to which the read/modify/write rules should be diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto index 2cc916454b..9e5a05c2ea 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // 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. -// syntax = "proto3"; @@ -210,7 +209,7 @@ message ValueRange { // RowFilter.Chain and RowFilter.Interleave documentation. // // The total serialized size of a RowFilter message must not -// exceed 4096 bytes, and RowFilters may not be nested within each other +// exceed 20480 bytes, and RowFilters may not be nested within each other // (in Chains or Interleaves) to a depth of more than 20. message RowFilter { // A RowFilter which sends rows through several RowFilters in sequence. diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fa3331966a..5b1f41a5a3 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 - 2.5.2 + 2.5.3 diff --git a/samples/native-image-sample/README.md b/samples/native-image-sample/README.md new file mode 100644 index 0000000000..a6b38de140 --- /dev/null +++ b/samples/native-image-sample/README.md @@ -0,0 +1,113 @@ +# BigTable Sample Application with Native Image + +This application uses the [Google Cloud BigTable Client Libraries](https://cloud.google.com/bigtable/docs/reference/libraries) and is compatible with Native Image compilation. + +The application runs through some simple BigTable Client Library operations to demonstrate compatibility. + +## Setup Instructions + +You will need to follow these prerequisite steps in order to run the samples: + +1. If you have not already, [create a Google Cloud Platform Project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project). + +2. Install the [Google Cloud SDK](https://cloud.google.com/sdk/) which will allow you to run the sample with your project's credentials. + + Once installed, log in with Application Default Credentials using the following command: + + ``` + gcloud auth application-default login + ``` + + **Note:** Authenticating with Application Default Credentials is convenient to use during development, but we recommend [alternate methods of authentication](https://cloud.google.com/docs/authentication/production) during production use. + +3. Install the GraalVM compiler. + + You can follow the [official installation instructions](https://www.graalvm.org/docs/getting-started/#install-graalvm) from the GraalVM website. + After following the instructions, ensure that you install the native image extension installed by running: + + ``` + gu install native-image + ``` + + Once you finish following the instructions, verify that the default version of Java is set to the GraalVM version by running `java -version` in a terminal. + + You will see something similar to the below output: + + ``` + $ java -version + + openjdk version "11.0.7" 2020-04-14 + OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02) + OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing) + ``` + +## BigTable Environment setup +The following sections describe how you can run the sample application against the BigTable emulator or a real BigTable instance. + +1. *(Using emulator)* If you wish to run the application against the [BigTable emulator](https://cloud.google.com/bigtable/docs/emulator), ensure that you have the [Google Cloud SDK](https://cloud.google.com/sdk) installed. + + In a new terminal window, start the emulator via `gcloud`: + + ``` + gcloud beta emulators bigtable start --host-port=localhost:9010 + ``` + + Leave the emulator running in this terminal for now. + In the next section, we will run the sample application against the BigTable emulator instance. + +2. *(Using real BigTable instance)* If instead you wish to run the application against a real BigTable instance, ensure you already have a BigTable instance created. + + For example, the following command creates a new BigTable instance named `nativeimage-test-instance`. + + ``` + gcloud bigtable instances create nativeimage-test-instance \ + --cluster=nativeimage-test-cluster \ + --cluster-zone=us-central1-c \ + --cluster-num-nodes=1 \ + --display-name=nativeimage-test-instance + ``` + + You can also manually manage your BigTable resources through the [BigTable Cloud Console view](http://console.cloud.google.com/bigtable). + +## Run with Native Image Compilation + +1. Compile the application with the Native Image compiler. + + ``` + mvn package -P native -DskipTests + ``` + +2. **(Optional)** If you're using the emulator, export the `BIGTABLE_EMULATOR_HOST` as an environment variable in your terminal. + + ``` + export BIGTABLE_EMULATOR_HOST=localhost:9010 + ``` + + The BigTable Client Libraries will detect this environment variable and automatically connect to the emulator instance if this variable is set. + +3. Run the application. + Pass in the BigTable instance you wish to use via the `-Dbigtable.instance` property. + + ``` + ./target/bigtable-sample -Dbigtable.instance={BIGTABLE_INSTANCE_NAME} + ``` + +4. The application will run through some basic BigTable operations and log some output statements. + + ``` + Created table: nativeimage-test-table2b5b0031-f4ea-4c39-bc0c-bf6c3c62c90c + Successfully wrote row: phone#1608775178843000 + Reading phone data in table: + Key: phone#1608775178843000 + connected_cell: @1608775178843000 + connected_wifi: @1608775178843000 + os_build: PQ2A.190405.003 @1608775178843000 + Deleted table: nativeimage-test-table2b5b0031-f4ea-4c39-bc0c-bf6c3c62c90c + ``` +## Run integration test for the sample + +In order to run the sample's integration test, call the following command: + + ``` + mvn test -P native + ``` \ No newline at end of file diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml new file mode 100644 index 0000000000..77872cfce4 --- /dev/null +++ b/samples/native-image-sample/pom.xml @@ -0,0 +1,139 @@ + + + 4.0.0 + com.example.bigtable + native-image-sample + Native Image Sample + https://github.com/googleapis/java-bigtable + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + + com.google.cloud + libraries-bom + 24.4.0 + pom + import + + + + + + + com.google.cloud + google-cloud-bigtable + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + com.example.bigquery.NativeImageBigtableSample + + + + + + + + + + + + native + + + + com.google.cloud + native-image-support + 0.12.6 + + + org.junit.vintage + junit-vintage-engine + 5.8.2 + test + + + org.graalvm.buildtools + junit-platform-native + 0.9.9 + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + 0.9.10 + true + + com.example.bigtable.NativeImageBigtableSample + + + --no-fallback + --no-server + + + + + build-native + + build + test + + package + + + test-native + + test + + test + + + + + + + + \ No newline at end of file diff --git a/samples/native-image-sample/src/main/java/com/example/bigtable/NativeImageBigtableSample.java b/samples/native-image-sample/src/main/java/com/example/bigtable/NativeImageBigtableSample.java new file mode 100644 index 0000000000..99d902721b --- /dev/null +++ b/samples/native-image-sample/src/main/java/com/example/bigtable/NativeImageBigtableSample.java @@ -0,0 +1,148 @@ +/* + * Copyright 2020-2021 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 + * + * https://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. + */ + +package com.example.bigtable; + +import com.google.api.gax.rpc.ServerStream; +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.CreateInstanceRequest; +import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; +import com.google.cloud.bigtable.admin.v2.models.Instance; +import com.google.cloud.bigtable.admin.v2.models.StorageType; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowCell; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.util.Map.Entry; +import java.util.UUID; + +/** Sample Cloud BigTable application. */ +public class NativeImageBigtableSample { + + private static final String INSTANCE_NAME = + System.getProperty("bigtable.instance", "nativeimage-test-instance"); + private static final String TABLE_NAME = "nativeimage-test-"; + + private static final String COLUMN_FAMILY_NAME = "stats_summary"; + + /** Entrypoint to the BigTable sample application. */ + public static void main(String[] args) throws IOException { + String projectId = ServiceOptions.getDefaultProjectId(); + + BigtableTableAdminSettings adminClientSettings = + BigtableTableAdminSettings.newBuilder() + .setInstanceId(INSTANCE_NAME) + .setProjectId(projectId) + .build(); + BigtableDataSettings clientSettings = + BigtableDataSettings.newBuilder() + .setInstanceId(INSTANCE_NAME) + .setProjectId(projectId) + .build(); + BigtableInstanceAdminSettings instanceAdminSettings = + BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId).build(); + + BigtableTableAdminClient adminClient = BigtableTableAdminClient.create(adminClientSettings); + BigtableDataClient standardClient = BigtableDataClient.create(clientSettings); + BigtableInstanceAdminClient instanceAdminClient = + BigtableInstanceAdminClient.create(instanceAdminSettings); + + if (!instanceAdminClient.exists(INSTANCE_NAME)) { + instanceAdminClient.createInstance( + CreateInstanceRequest.of(INSTANCE_NAME) + .addCluster("cluster", "us-central1-f", 3, StorageType.SSD) + .setType(Instance.Type.PRODUCTION) + .addLabel("example", "instance_admin")); + } + String tableName = TABLE_NAME + UUID.randomUUID().toString().replace("-", ""); + + createTable(adminClient, tableName); + + // Add data into table + ImmutableMap dataWithLong = + ImmutableMap.of("connected_cell", 1L, "connected_wifi", 1L); + ImmutableMap dataWithStrings = ImmutableMap.of("os_build", "PQ2A.190405.003"); + + long timestamp = System.currentTimeMillis() * 1000; + insertData(standardClient, tableName, timestamp, dataWithLong, dataWithStrings); + readData(standardClient, tableName); + + // Clean up + deleteTable(adminClient, tableName); + } + + static void readData(BigtableDataClient client, String tableId) { + Query query = Query.create(tableId).prefix(""); + ServerStream rows = client.readRows(query); + + System.out.println("Reading phone data in table:"); + for (Row row : rows) { + System.out.println("Key: " + row.getKey().toStringUtf8()); + for (RowCell cell : row.getCells()) { + System.out.printf( + "\t%s: %s @%s\n", + cell.getQualifier().toStringUtf8(), + cell.getValue().toStringUtf8(), + cell.getTimestamp()); + } + System.out.println(); + } + } + + public static void insertData( + BigtableDataClient client, + String tableId, + long timestamp, + ImmutableMap dataWithLong, + ImmutableMap dataWithStrings) { + String rowKey = String.format("phone#%d", timestamp); + RowMutation rowMutation = RowMutation.create(tableId, rowKey); + for (Entry longEntry : dataWithLong.entrySet()) { + rowMutation.setCell( + COLUMN_FAMILY_NAME, + ByteString.copyFrom(longEntry.getKey().getBytes()), + timestamp, + longEntry.getValue()); + } + + for (Entry stringEntry : dataWithStrings.entrySet()) { + rowMutation.setCell( + COLUMN_FAMILY_NAME, stringEntry.getKey(), timestamp, stringEntry.getValue()); + } + + client.mutateRow(rowMutation); + System.out.println("Successfully wrote row: " + rowKey); + } + + public static void createTable(BigtableTableAdminClient adminClient, String table) { + adminClient.createTable(CreateTableRequest.of(table).addFamily(COLUMN_FAMILY_NAME)); + System.out.println("Created table: " + table); + } + + static void deleteTable(BigtableTableAdminClient adminClient, String table) { + adminClient.deleteTable(table); + System.out.println("Deleted table: " + table); + } +} diff --git a/samples/native-image-sample/src/test/java/com/example/bigtable/NativeImageBigtableTest.java b/samples/native-image-sample/src/test/java/com/example/bigtable/NativeImageBigtableTest.java new file mode 100644 index 0000000000..f1ecf94661 --- /dev/null +++ b/samples/native-image-sample/src/test/java/com/example/bigtable/NativeImageBigtableTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2022 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 + * + * https://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. + */ + +package com.example.bigtable; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; +import com.google.cloud.bigtable.admin.v2.models.CreateInstanceRequest; +import com.google.cloud.bigtable.admin.v2.models.Instance; +import com.google.cloud.bigtable.admin.v2.models.StorageType; +import com.google.cloud.bigtable.data.v2.BigtableDataClient; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.common.collect.ImmutableMap; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.time.Instant; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class NativeImageBigtableTest { + + private static final String INSTANCE_NAME = + System.getProperty("bigtable.instance", "nativeimage-it-instance"); + private static final String TABLE_SUFFIX = "nativeimage-it-"; + + private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); + + private static final Instant TIMESTAMP = Instant.EPOCH; + + private String tableName; + private BigtableDataClient dataClient; + private BigtableTableAdminClient adminClient; + + private static PrintStream originalOut; + public ByteArrayOutputStream bout; + + @After + public void tearDown() { + System.setOut(originalOut); + bout.reset(); + } + + @Before + public void setUp() throws IOException { + // Create instance if not present + BigtableInstanceAdminSettings instanceAdminSettings = + BigtableInstanceAdminSettings.newBuilder().setProjectId(PROJECT_ID).build(); + BigtableInstanceAdminClient instanceAdminClient = + BigtableInstanceAdminClient.create(instanceAdminSettings); + if (!instanceAdminClient.exists(INSTANCE_NAME)) { + instanceAdminClient.createInstance( + CreateInstanceRequest.of(INSTANCE_NAME) + .addCluster("cluster", "us-central1-f", 3, StorageType.SSD) + .setType(Instance.Type.PRODUCTION) + .addLabel("example", "instance_admin")); + } + + BigtableTableAdminSettings adminClientSettings = + BigtableTableAdminSettings.newBuilder() + .setInstanceId(INSTANCE_NAME) + .setProjectId(PROJECT_ID) + .build(); + BigtableDataSettings clientSettings = + BigtableDataSettings.newBuilder() + .setInstanceId(INSTANCE_NAME) + .setProjectId(PROJECT_ID) + .build(); + adminClient = BigtableTableAdminClient.create(adminClientSettings); + tableName = TABLE_SUFFIX + UUID.randomUUID().toString().replace("-", ""); + NativeImageBigtableSample.createTable(adminClient, tableName); + + dataClient = BigtableDataClient.create(clientSettings); + + // To test output stream + originalOut = System.out; + bout = new ByteArrayOutputStream(); + System.setOut(new PrintStream(bout)); + } + + @Test + public void testReadData() { + ImmutableMap dataWithInts = ImmutableMap.of("connection_cell", 1L); + ImmutableMap dataWithStrings = ImmutableMap.of("os_build", "build_value"); + NativeImageBigtableSample.insertData( + dataClient, tableName, TIMESTAMP.getEpochSecond(), dataWithInts, dataWithStrings); + + NativeImageBigtableSample.readData(dataClient, tableName); + + String output = bout.toString(); + assertThat(output) + .contains( + "Successfully wrote row: phone#0\n" + + "Reading phone data in table:\n" + + "Key: phone#0\n" + + "\tconnection_cell: \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001 @0\n" + + "\tos_build: build_value @0\n\n"); + + // Clean up + NativeImageBigtableSample.deleteTable(adminClient, tableName); + } +} diff --git a/samples/pom.xml b/samples/pom.xml index a05f97835d..345631a529 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -31,6 +31,7 @@ install-without-bom snapshot snippets + native-image-sample @@ -46,7 +47,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.6.12 true diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5f66a02cfd..64a1d56ed8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 2.5.3 + 2.6.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index fd2e29a69a..3144f68817 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 24.2.0 + 24.4.0 pom import diff --git a/versions.txt b/versions.txt index 63dc15cc87..8ce94b2c9a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:2.5.3:2.5.3 -grpc-google-cloud-bigtable-admin-v2:2.5.3:2.5.3 -grpc-google-cloud-bigtable-v2:2.5.3:2.5.3 -proto-google-cloud-bigtable-admin-v2:2.5.3:2.5.3 -proto-google-cloud-bigtable-v2:2.5.3:2.5.3 -google-cloud-bigtable-emulator:0.142.3:0.142.3 +google-cloud-bigtable:2.6.0:2.6.0 +grpc-google-cloud-bigtable-admin-v2:2.6.0:2.6.0 +grpc-google-cloud-bigtable-v2:2.6.0:2.6.0 +proto-google-cloud-bigtable-admin-v2:2.6.0:2.6.0 +proto-google-cloud-bigtable-v2:2.6.0:2.6.0 +google-cloud-bigtable-emulator:0.143.0:0.143.0